A question about audio output

Just starting out? Need help? Post your questions and find answers here.
User avatar
tft
User
User
Posts: 99
Joined: Mon Dec 29, 2008 9:34 am

A question about audio output

Post by tft »

Hallo

My computer has 6 audio jacks. I would like to use one of them as an additional headphone output to play a separate audio track. Anyone an idea. It's still about the anime project.

THX TFT
TFT seid 1989
Aktuelles Projekte : Driving School Evergarden
YouTube : Pure Basic to go
FaceBook : Temuçin SourceMagic Games
DISCORD : SourceMagic
W10 , i9 9900K ,32 GB Ram , GTX Titan , 3 Monitore FHD
ARDUINO Freak :-)
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: A question about audio output

Post by infratec »

From which OS are you talking :?: :?: :?:
Or do you need solutions for all OSs?
User avatar
tft
User
User
Posts: 99
Joined: Mon Dec 29, 2008 9:34 am

Re: A question about audio output

Post by tft »

Windows 10 PC
TFT seid 1989
Aktuelles Projekte : Driving School Evergarden
YouTube : Pure Basic to go
FaceBook : Temuçin SourceMagic Games
DISCORD : SourceMagic
W10 , i9 9900K ,32 GB Ram , GTX Titan , 3 Monitore FHD
ARDUINO Freak :-)
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: A question about audio output

Post by AndyMK »

You can use the Portaudio library
gregreen
User
User
Posts: 28
Joined: Fri Apr 21, 2023 7:26 pm

Re: A question about audio output

Post by gregreen »

I've been looking at portaudio and the purebasic code I've been able to find does load the .dll and the c library and reports the ASIO audio channels (I have an 8 channel Gigaport Ex.

What I can't figure out is how to play a wav or mp3 file out a specific channel. The code reports pointer errors and things related to memory. I'm using Windows 11. I've stared at everything and I have no clue. It would be wonderful if someone would post a purebasic example file that works. The Gigaport Ex is an awesome 8 channel USB soundcard with ASIO drivers that is fantastic. I'm motivated to investigate a way to utilize it with purebasic but so far am lost in the weeds trying to sort it out.

If one of the genius' here would comment more than "...use the Portaudio library" that would be totally awesome and worth a measure of support/Patreon donation... Thanks in advance! Love purebasic!
morosh
Enthusiast
Enthusiast
Posts: 333
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: A question about audio output

Post by morosh »

Not sure if I've understand you correctly, but if you mean to select a particular device, have a look at: viewtopic.php?t=79723

HTH
PureBasic: Surprisingly simple, diabolically powerful
gregreen
User
User
Posts: 28
Joined: Fri Apr 21, 2023 7:26 pm

Re: A question about audio output

Post by gregreen »

I saw that but wasn't able to make anything work, except for running the program svcl.exe to switch the default output. That works, but it feels a bit hacky. Let's say I had 4 stereo wav files I wanted to play simultaneously out four different sound devices. So far, that seems above my paygrade, and while I can think of a very "hacky" way to do it with svcl.exe I'm not keen to invest the time coding that. (I might though, for proof of concept)

It would be very cool to be able to just:
Loadmovie(0, moviename$)
PlayMovie(0, WindowID(0), audioOutputDeviceName$)

Dolby Atmos is a thing that's coming on the consumer side, so this type of add on could be useful.

I love how Purebasic lets me quickly try out ideas with the help of some awesome folks here on the forum.
Post Reply