octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio playback and classes


From: Mike Miller
Subject: Re: Audio playback and classes
Date: Wed, 3 Jul 2013 08:35:36 -0400

On Tue, Jul 2, 2013 at 11:56:03 +0300, Vytautas Jancauskas wrote:
> All playback modes supported on MATLAB should be working now. It would
> be great if people tried it out and reported any problems. It should
> work just like MATLAB classes. The only exception would be 24 bit
> playback on big endian systems which does not work yet.

I have tested this a bit, haven't reviewed the code yet at all, just
looking at functionality, and I ran into a couple of problems.

The get(player, {property1, property2}) form returns a matrix instead
of a cell array:

  octave:3> get (player, {"CurrentSample", "TotalSamples"})
  ans =
          0   220500

The return value should rather be

  ans =
  {
    [1,1] = 0
    [1,2] =  220500
  }

The set(player, ...) function does not accept the struct and cell
array argument types yet.

I've been able to cause both scrambled sound output and a segfault by
calling the play and stop function repeatedly, for example:

  octave:1> data = sin (2*pi*440*[0:5*44100-1]/44100)';
  octave:2> player = audioplayer (data, 44100);
  octave:3> play (player);
  ## Do not wait for 5-second tone to finish
  octave:4> stop (player);
  octave:5> play (player);
  ## Now getting scrambled audio output

  octave:1> data = sin (2*pi*440*[0:5*44100-1]/44100)';
  octave:2> player = audioplayer (data, 44100);
  octave:3> play (player);
  ## Do not wait for 5-second tone to finish
  octave:4> stop (player);
  octave:5> quit
  panic: Segmentation fault -- stopping myself...

  octave:1> data = sin (2*pi*440*[0:5*44100-1]/44100)';
  octave:2> player = audioplayer (data, 44100);
  octave:3> play (player);
  ## Do not wait for 5-second tone to finish
  octave:4> stop (player);
  octave:5> player = audioplayer (data, 44100);
  ## Now getting audio output without calling play
  octave:6> stop (player);
  panic: Segmentation fault -- stopping myself...

If I wait for playback to finish or use playblocking, I have not seen
any of these problems.

-- 
mike


reply via email to

[Prev in Thread] Current Thread [Next in Thread]