discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSSound and gsnd


From: Enrico Sersale
Subject: Re: NSSound and gsnd
Date: Thu, 1 Aug 2002 13:24:17 +0300 (EEST)

On Wed, 31 Jul 2002, Yen-Ju Chen wrote:

> Hi,
>
>   I just notice that NSSound and gsnd are in CVS.
>   And it seems that NSSound will decode the whole file at once.
>   If I want to write a NSSound subclass which can handle MP3/OGG,
>   it will takes a lot of time to decode the whole file
>   before sent them into gsnd.
>   Is there any way, or plan, that NSSound can send the data
>   piece by piece to gsnd so that it doesn't need to decode
>   the whole file at once.
>
>   Thanx.
>
>   Yen-Ju

If you want to see an example of sound class that plays from a stream,
take a look at the MusicKit. I think that it does exactly wath you want.

Writing this implementation of NSSound I wanted only to create a simple,
portable and efficient interface to play "system sounds". It is part of
the gui library and my concern was to not add, how is possible,
dependencies on external libraries, threads or other strange things. The
only external library used is libaudiofile, a very portable c library that
builds on many unix and on windows.

I've not a Mac to test this, but I think that also the apple
implementation doesn't do much more. From their documentation:  "The
NSSound class provides a simple interface for loading and playing AIFF,
WAV, and NeXT ".snd" files. NSSound supports 16bit, mono and stereo,
44.1KHz and 22.05KHz data."  (BTW actually we support more formats and any
frame rate)

Said that, I must also add that gsnd is an other think. Not being a part
of gui but only a tool, I think that it could be easyly modified to accept
also, for example, a NSFileHandle or a NSPipe from which read the data to
play.




reply via email to

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