Monday, July 29, 2013

The Status of the Project

All of the major goals we set for the program were achieved before midterm with small exceptions. That means that audiodevinfo, audioplayer and audiorecorder (supposedly) work as they are described in MATLAB documentation here. There are some small exceptions. Notable properties that depend on the timer class don't work. These are used to issue command during recording and playback periodically. There still does not seem to be a clear agreement on what to do after the midterm, however there are several good possibilities.

Thursday, July 18, 2013

Audiorecorder Class is Working

All of the functionality of the audiorecorder is implemented except for the properties dependent on the timer class.

octave:1> recorder = audiorecorder (44100, 16, 2);
octave:2> record (recorder);
# record something using the default recording device on your system
octave:3> stop (recorder);
# now you have several options, for example you get get the data for manipulation:
octave:4> data = getaudiodata (recorder);
# play the recorded data directly
octave:5> play (recorder);
# or get an audioplayer object containing the recorded audio
octave:6> player = audioplayer (recorder);
# or alternatively
octave:7> player = getplayer (recorder);

All the other examples from MATLAB documentation should be working as well.

Thursday, July 11, 2013

Directions for Further Development

Since both audioplayer and audiorecorder classes are going to be completed before the midterm, thus effectively completing the goals outlined in the original GSoC proposal we need to come up with things to do after the midterm. I have the following suggestions:
  1. Implement audioinfo, audioread and audiowrite functionality that is present in MATLAB. I can do this using libsndfile library for cross-platform audio file reading and writing. I have worked with this library before and I expect this would not be as big a task as it might seem at first.
  2. Implement the timer class from MATLAB. Possibly using Boost::Thread for threading? It is needed to fully implement all the functionality in audioplayer and audiorecorder.
  3. Callback based playback and recording. That is allow the user to register an Octave function to be called during the processing of each audio buffer and get it to provide the data for playback or to do something with the recorded audio.
  4. Anything else you might think is a good idea to have in Octave and falls roughly within it's audio/DSP functionality.

Wednesday, July 10, 2013

New Functionality

Most of the functionality of MATLAB's audioplayer class is working now. The only two missing pieces of functionality is the ability to specify an audiorecorder object to use. I am not even fully sure what that is for yet. The other piece of missing functionality are the StartFcn, StopFcn, TimerFcn and TimerPeriod properties that require a working timer class. Other than that any code using audioplayer that works in MATLAB should work in Octave too if you compile my code from https://bitbucket.org/bucket_brigade/octave-sound. Here are some examples to try out.

octave:1> sound = randn(2, 441000) - 0.5;
octave:2> player = audioplayer(sound, 44100);
octave:3> play(player);
# wait a little bit
octave:4> pause(player);
# will pause the playback
octave:5> resume(player);
# will resume the playback where it was paused


octave:1> sound = randn(2, 441000) - 0.5;
octave:2> player = audioplayer(sound, 44100, 8);
octave:3> player.BitsPerSample
ans = 8
octave:4> player.Tag = "testing";
octave:5> player.Tag
ans = testing

You can obviously load an audio file if you have one in suitable format using octave's loadaudio function, apply some signal processing on it and play that back.