Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (monk12, Quad), 830 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
stereo audio from memory #472487
04/30/18 18:08
04/30/18 18:08
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Hey there! I'd like to open/play a stereo audio file from memory (for ingame music). It sounds trivial but everything I've tested didn't work so far.
snd_play doesn't support stereo files and media_play for some reason is unable to stream from memory.

Is there any other way to accomplish this?

regrads, Kartoffel


POTATO-MAN saves the day! - Random
Re: stereo audio from memory [Re: Kartoffel] #472491
04/30/18 18:24
04/30/18 18:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
2 alternatives that support playing from memory:
1) Get an irrKlang license for 65€. Writing a wrapper for that is easy and quick.
2) Write your own DirectSound implementation.

Both options require a non-zero amount of work but the results will be way beyond what the very limited acknexs sound engine has to offer.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: stereo audio from memory [Re: Superku] #472494
04/30/18 18:29
04/30/18 18:29
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
okay, I'll take a look at them. thanks for the recommendations.


POTATO-MAN saves the day! - Random
Re: stereo audio from memory [Re: Kartoffel] #472496
04/30/18 21:29
04/30/18 21:29
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I use to play two balanced mono sounds. I have played long songs with no desynchronization but the risk is there, I think.

Re: stereo audio from memory [Re: txesmi] #472500
05/01/18 08:16
05/01/18 08:16
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
That's what I'm afraid of. But interesting to hear that you managed to make it work that way.


POTATO-MAN saves the day! - Random
Re: stereo audio from memory [Re: Kartoffel] #472538
05/03/18 14:21
05/03/18 14:21
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
As far as I know there's a way to automatically link all dll functions, right?
Does anyone know how this works? I don't want to spend a ton of time to link all functions of my wrapper manually.

Edit: I did it manually now but I can't seem to link a single function even though I did it the same way I usually do confused
Edit2: oops, I didn't see that irrklang had some dependencies (the irrklang dll, duh). The linking works now.

Last edited by Kartoffel; 05/03/18 16:31.

POTATO-MAN saves the day! - Random
Re: stereo audio from memory [Re: Superku] #472539
05/03/18 18:11
05/03/18 18:11
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline OP
Expert
Kartoffel  Offline OP
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Originally Posted By: Superku
1) Get an irrKlang license for 65€. Writing a wrapper for that is easy and quick.
Well, I wouldn't say it was that quick and easy, but definitely more convinient than writing everything using low level audio APIs.

Anyway, looks like everything is working right now. Music files are decrypted at runtime (not during playback, though) and can be loaded straight from memory into irrKlang. Thanks again.


POTATO-MAN saves the day! - Random
Re: stereo audio from memory [Re: Kartoffel] #472540
05/03/18 18:46
05/03/18 18:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Yeah, the whole container -> memory -> playback stuff takes a while. The initial setup or getting it running/ irrKlang init + playing a file is quick and easy, comparatively. O:-)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1