sound in lua

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

sound in lua

Adrian Sietsma
i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)

step 1: add a sound record/play library; has anyone done this ?

what i would like is feedback on posible uses / abstractions. i know Windows audio well, but not linux / unix.

i'm considering an abstration like io/file : off the cuff -

object = sound.open(format)
object = sound.readfile(filename)

object:record(...)

...
object.play(...)

so :  what belongs to which level of abstraction ?

i aim to (eventually) build a basic win32 sound library.
it raises some interesting threading / callback issues too.

Adrian

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Asko Kauppi-3

Have you considered SDL's audio capabilities? Not the raw core audio (too low level) but have a look at SDLmixer. It's used in games afaik, and is multi-platform. I'd be willing to make a binding (have been planning anyhow, just not a usage case before this). What do you say?

-ak

8.1.2005 kello 11:31, Adrian Sietsma kirjoitti:

i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)

step 1: add a sound record/play library; has anyone done this ?

what i would like is feedback on posible uses / abstractions. i know Windows audio well, but not linux / unix.

i'm considering an abstration like io/file : off the cuff -

object = sound.open(format)
object = sound.readfile(filename)

object:record(...)

...
object.play(...)

so :  what belongs to which level of abstraction ?

i aim to (eventually) build a basic win32 sound library.
it raises some interesting threading / callback issues too.

Adrian



Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Philippe Lhoste
In reply to this post by Adrian Sietsma
Adrian Sietsma wrote:
i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)

step 1: add a sound record/play library; has anyone done this ?

what i would like is feedback on posible uses / abstractions. i know Windows audio well, but not linux / unix.

i'm considering an abstration like io/file : off the cuff -

object = sound.open(format)
object = sound.readfile(filename)

object:record(...)

...
object.play(...)

so :  what belongs to which level of abstraction ?

i aim to (eventually) build a basic win32 sound library.
it raises some interesting threading / callback issues too.

Pure Win32 or portable to Linux that you mention above?

I have no experience with it, but I often see references to OpenAL for audio uses: http://www.openal.org/

I believe a Lua 4 binding was made within Yindo, but this project is outdated (as is Lua 4) and probably dead (lack of resources and time?), although the site <http://www.yindo.com/> is still alive. Too bad, it was interesting.

FMOD is also quite used, but not free for commercial use (which is fair, IMHO). http://www.fmod.org/

I didn't see Lua bindings for these in http://lua-users.org/wiki/LibrariesAndBindings Freya <http://www.geekzine.net/freya/> uses FMOD, but through the Allegro library.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

analisifunzionale
In reply to this post by Adrian Sietsma
Adrian Sietsma wrote:

i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)

step 1: add a sound record/play library; has anyone done this ?
[cut]

Try http://www.openal.org/ !

analisifunzionale!

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Philippe Lhoste
In reply to this post by Philippe Lhoste
Philippe Lhoste wrote:

Adrian Sietsma wrote:
i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)

step 1: add a sound record/play library; has anyone done this ?

what i would like is feedback on posible uses / abstractions. i know Windows audio well, but not linux / unix.

i'm considering an abstration like io/file : off the cuff -

object = sound.open(format)
object = sound.readfile(filename)

object:record(...)

...
object.play(...)

so :  what belongs to which level of abstraction ?

i aim to (eventually) build a basic win32 sound library.
it raises some interesting threading / callback issues too.

Pure Win32 or portable to Linux that you mention above?

I have no experience with it, but I often see references to OpenAL for audio uses: http://www.openal.org/

I believe a Lua 4 binding was made within Yindo, but this project is outdated (as is Lua 4) and probably dead (lack of resources and time?), although the site <http://www.yindo.com/> is still alive. Too bad, it was interesting.

FMOD is also quite used, but not free for commercial use (which is fair, IMHO). http://www.fmod.org/

I didn't see Lua bindings for these in http://lua-users.org/wiki/LibrariesAndBindings Freya <http://www.geekzine.net/freya/> uses FMOD, but through the Allegro library.

Erm, not FMOD, but DUMB: http://dumb.sourceforge.net/index.php which is quite different...

That's funny, yesterday I took a look at the WiN32 API function mciSendString, thinking that binding this single function would add a whole world of multimedia to Lua (on Windows).

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Adrian Sietsma
In reply to this post by Asko Kauppi-3
Asko Kauppi wrote:
Have you considered SDL's audio capabilities?

point me to a link, and i'll check it out now...

Adrian

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Adrian Sietsma
In reply to this post by Philippe Lhoste
Philippe Lhoste wrote:
Pure Win32 or portable to Linux that you mention above?

My initial desire is for a windows (.dll) library.
The question is : is it better to have cross-compilable c code,
or a defined ui / table structure, and dedicated platform libraries ?

a pure win32 binding is much simpler than piggybacking on a large OS multiplatform library, which still won't support (palm, ... device of choice, etc)

I have no experience with it, but I often see references to OpenAL for audio uses: http://www.openal.org/

i'll take a peek. thanx

Adrian



Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

ccos
for a nice portable soundfile library, you might also have a peak at libsndfile:

http://www.mega-nerd.com/libsndfile/

and by the same guy, secret rabbit code (libsamplerate):

http://www.mega-nerd.com/SRC/

and for portable audio i/o have a look at portaudio:

http://www.portaudio.com/

both small libs which do one thing and do them well, imho.
don't know if they'll do what you want though, i have no idea what "voip work" is.

cheers,
_c


On 08/01/2005, at 9:28 PM, Adrian Sietsma wrote:

Philippe Lhoste wrote:
Pure Win32 or portable to Linux that you mention above?

My initial desire is for a windows (.dll) library.
The question is : is it better to have cross-compilable c code,
or a defined ui / table structure, and dedicated platform libraries ?

a pure win32 binding is much simpler than piggybacking on a large OS multiplatform library, which still won't support (palm, ... device of choice, etc)

I have no experience with it, but I often see references to OpenAL for audio uses: http://www.openal.org/

i'll take a peek. thanx

Adrian




Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Petite Abeille

On Jan 08, 2005, at 10:44, ccos wrote:

i have no idea what "voip work" is

Voice over IP (VoIP) perhaps?

http://www.fcc.gov/voip/

PA.


Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Adrian Sietsma
PA wrote:

Voice over IP (VoIP) perhaps?

http://www.fcc.gov/voip/


yep. i'm still at the "stick open-source bits together" stage, using openh323, but then i thought about luasocket...

... and decided that i would first need sound record/playback
(baby steps, one at a time)

Adrian

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Adrian Sietsma
In reply to this post by Philippe Lhoste
Philippe Lhoste wrote:
Erm, not FMOD, but DUMB: http://dumb.sourceforge.net/index.php which is quite different...
looks interesting.. ive just downoaded it

openal appears to have no record functionality : it looks great for games (3d/spatial sound) but i want to record and (later) echo cancel ;-)


That's funny, yesterday I took a look at the WiN32 API function mciSendString, thinking that binding this single function would add a whole world of multimedia to Lua (on Windows).

that's about where i'm at.
i'm using pwlib and openh323 for the voip stuff, but it's got 20 x what i want to do in lua (at present), and there are threading issues as well.

Adrian


Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Adrian Sietsma
In reply to this post by ccos
ccos wrote:

for a nice portable soundfile library, you might also have a peak at libsndfile:

http://www.mega-nerd.com/libsndfile/

and by the same guy, secret rabbit code (libsamplerate):

http://www.mega-nerd.com/SRC/

and for portable audio i/o have a look at portaudio:

http://www.portaudio.com/


thanks. i've downloaded portaudio and libsndfile (required by portaudio) to look at. although cross-platform support is required (eventually), the question is this - is it better to

a) make a lua binding to an existing (x-platform) library, or

b) define a lua interface, and make a dedicated (simple) lua binding for each os as required.

option a) has a potential problem with library dependancies - luasound ver.x needs portaudio ver.y needs libsndfile ver.z ... but the code is out there and available.

option b) would give me what i want now, but
who does the other platforms ?
what goes in the interface ?

Adrian
(why is it that "interesting" ideas come when you're already busy ?)

Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Daniel Quintela
In reply to this post by Adrian Sietsma
Adrian Sietsma escribió:

i'm looking at doing some voip work (in windows), and thinking of lua...
(but that's some way off yet)
[...]
Adrian

Take a look at http://iaxclient.sourceforge.net  (wiax.dll is only 61Kb!).

--DQ


Reply | Threaded
Open this post in threaded view
|

Re: sound in lua

Asko Kauppi-3
In reply to this post by Adrian Sietsma

[iMac:~] asko% fink apropos mixer
Information about 4405 packages read in 6 seconds.
sdl-mixer 1.2.6-12 SDL multi-channel audio mixer library sdl-mixer-shlibs 1.2.6-12 SDL multi-channel audio mixer library

Which OS are you working on?


8.1.2005 kello 12:19, Adrian Sietsma kirjoitti:

 Asko Kauppi wrote:
Have you considered SDL's audio capabilities?

point me to a link, and i'll check it out now...

Adrian