discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSSound and gsnd


From: Yen-Ju Chen
Subject: Re: NSSound and gsnd
Date: Thu, 01 Aug 2002 08:33:12 -0400

 I agree that NSSound should be simple.
 I think I should emphsize my point on gsnd.
 Right now, gsnd only accept the whole decoded data,
 which cause the problem for big files.
 And since gsnd is the official sound daemon of GNUstep,
 it would be nice that it could offer some other interfaces
 that applications can feed the data piece by piece.
 Do you have any plan to do that ?

 By the way, maybe libsndfile
 (http://www.zip.com.au/~erikd/libsndfile/)
 could be another choice as external library.
 It is highly portable, and I think the most
 important point is that it is still under active developement.
 That's just a little suggestion.

 Yen-Ju

From: Enrico Sersale <enrico@www.imago.ro>
To: Yen-Ju Chen <yjchenx@hotmail.com>
CC: <discuss-gnustep@gnu.org>
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.




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com




reply via email to

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