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.

No comments:

Post a Comment