Taking care of old audio functions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Taking care of old audio functions

Mike Miller
All,

Now that we have modern audio support in the Octave default branch, what
should we do with the older legacy audio function files?

Here are the functions I'm looking at in scripts/audio:

 * loadaudio
 * playaudio
 * record
 * saveaudio
 * setaudio
 * wavread
 * wavwrite

Some of these are correct but duplicate functionality in the new-style
classes and functions, and some are just unmaintainable.

My suggestion would be to keep but rewrite the record, wavread, and
wavwrite function files as wrappers around the new-style functions. Both
wavread and wavwrite are still present in current versions of Matlab.

The rest, loadaudio, saveaudio, playaudio, and setaudio, should probably
be deprecated. The first three are fully replaced by the new functions.
The setaudio function looks like it is supposed to set the sound card
volume, by shelling out to a command that I don't have on my Debian
system. I don't see any equivalent function on TMW's web site.

We can also implement the missing functions sound and soundsc as simple
function file wrappers around the audioplayer class.

Thoughts?

--
mike

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Taking care of old audio functions

John W. Eaton
Administrator
On 01/11/2015 11:20 PM, Mike Miller wrote:

> All,
>
> Now that we have modern audio support in the Octave default branch, what
> should we do with the older legacy audio function files?
>
> Here are the functions I'm looking at in scripts/audio:
>
>   * loadaudio
>   * playaudio
>   * record
>   * saveaudio
>   * setaudio
>   * wavread
>   * wavwrite
>
> Some of these are correct but duplicate functionality in the new-style
> classes and functions, and some are just unmaintainable.
>
> My suggestion would be to keep but rewrite the record, wavread, and
> wavwrite function files as wrappers around the new-style functions.

I agree.

> The rest, loadaudio, saveaudio, playaudio, and setaudio, should probably
> be deprecated.

Yes, let's get deprecate and eventually remove these.

> We can also implement the missing functions sound and soundsc as simple
> function file wrappers around the audioplayer class.

OK.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: Taking care of old audio functions

Mike Miller
On Mon, Jan 12, 2015 at 12:08:06 -0500, John W. Eaton wrote:
> On 01/11/2015 11:20 PM, Mike Miller wrote:
> >My suggestion would be to keep but rewrite the record, wavread, and
> >wavwrite function files as wrappers around the new-style functions.
>
> I agree.

Ok, I started working on this, some fixes to the underlying functions
coming too.

> >The rest, loadaudio, saveaudio, playaudio, and setaudio, should probably
> >be deprecated.
>
> Yes, let's get deprecate and eventually remove these.

Ok, these functions are now deprecated.

> >We can also implement the missing functions sound and soundsc as simple
> >function file wrappers around the audioplayer class.
>
> OK.

Thanks for the feedback.

Part of this will be to make the player and recorder more responsive and
interruptible. I noticed you increased the audio buffer size in
http://hg.savannah.gnu.org/hgweb/octave/rev/8dce81f7448d, was there a
strong reason for this?

I'd like to decrease the buffer size again, and actually make it
relative to the audio sample rate, see my attached proposed changeset.
This results in recordings that are closer to the time requested by the
user, and means playback and recording can be interrupted more
immediately.

Comments on https://savannah.gnu.org/bugs/?44142 also welcome.

--
mike