Error on uos_AddIntoDevOut

Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Error on uos_AddIntoDevOut

LemonParty
Hello, again.
I trying to play mp3 file.
I successfuly called uos_CreatePlayer and uos_AddFromFile then I called uos_AddIntoDevOut and get error SIGSEGV on line #6750 "err := Pa_GetDefaultOutputDevice ();" in unit uos.
What it could be?
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

fredvs
Administrator
Hello.

Did you try the demo simpleplayer.lpi in /uos/examples/ ?

Is it working?
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

LemonParty
It working.
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

fredvs
Administrator
If simpleplayer demo is working, then maybe something is not ok in your code.
Did you load portaudio?

Can you show the code you used?
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

LemonParty
This is how I load library:
  Result:= uos_loadlib(nil, nil, PChar(ProgramsDir + 'dynlibs\Windows\64bit\LibMpg123-64.dll'), nil, nil, nil) = 0;
Result is true, I checked.

And this is how I load files. Checks not present, but I checked with debugger that first two functions work fine. FPlayerIndexes[i] = 1 in this case:
  uos_CreatePlayer(FPlayerIndexes[i]);
  InputIndex:= uos_AddFromFile(FPlayerIndexes[i], PChar(FTimerFrames[i].Sound), -1, -1, -1);
  {$if Defined(CPUARM) or Defined(CPUAARCH64)}
  // need a lower latency
  OutputIndex:= uos_AddIntoDevOut(FPlayerIndexes[i], -1, 0.3, -1, -1, -1, -1, -1) ;
  {$Else}
  OutputIndex:= uos_AddIntoDevOut(FPlayerIndexes[i], -1, -1, -1, -1, -1, -1, -1); {at this line occurs an error}
  {$EndIf}
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

fredvs
Administrator
LemonParty wrote
This is how I load library:
  Result:= uos_loadlib(nil, nil, PChar(ProgramsDir + 'dynlibs\Windows\64bit\LibMpg123-64.dll'), nil, nil, nil) = 0;
Result is true, I checked.
 
OK, this one is the problem.  The result is true but you did not load portaudio, who is the first parameter and is needed to access your sound card(s).

Try with this:

  Result:= uos_loadlib(PChar(ProgramsDir + 'dynlibs\Windows\64bit\LibPortaudio-64.dll'), nil, PChar(ProgramsDir + 'dynlibs\Windows\64bit\LibMpg123-64.dll'), nil, nil, nil) = 0;



Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

LemonParty
Yes! It solved an error. Music plays.
Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Error on uos_AddIntoDevOut

fredvs
Administrator
With pleasure and I am happy it works for you.