SA-MP Forums Archive
Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) (/showthread.php?tid=449201)



Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

pawn Код:
public Audio_OnPlay(playerid, handleid)
{
    handleid = playerVariables[playerid][pAudioHandle];
    return 1;
}

stock Function(playerid)
{
    Audio_PlayStreamed(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=656213", false, false, true);
    Audio_Set3DPosition(playerid, playerVariables[playerid][pAudioHandle], playerPos[0], playerPos[1], playerPos[2], 50.0);
    return 1;
}
It gives me this error in the client logs:

Quote:

"Error creating mixer for playback of "http://yp.shoutcast.com/sbin/tunein-station.pls?id=656213": Invalid handle"




Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - ReVo_ - 07.07.2013

this
Код:
public Audio_OnPlay(playerid, handleid)
{
    handleid = playerVariables[playerid][pAudioHandle];
    return 1;
}
to

Код:
public Audio_OnPlay(playerid, handleid)
{
    playerVariables[playerid][pAudioHandle] = handleid;
    return 1;
}
maybe you mean this?

When Audio_OnPlay is called?


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

Yeah-.. right, failed.

But the error persists, just tried:
Quote:

[21:50:56] Error creating mixer for playback of "http://yp.shoutcast.com/sbin/tunein-station.pls?id=656213": Invalid handle




Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - ReVo_ - 07.07.2013

When you call the function, Audio_OnPlay has already been called? Are you sure?

Add a debug in Audio_OnPlay, and debug the playerVariables[playerid][pAudioHandle] inside Function ( .. ) with the value

Код:
printf("handle value: %d", playerVariables[playerid][pAudioHandle]);
    Audio_Set3DPosition(playerid, playerVariables[playerid][pAudioHandle], playerPos[0], playerPos[1], playerPos[2], 50.0);



Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

Quote:

[22:09:11] Handle in Callback: 1
[22:09:12] Handle in Function: 1

As you can see, it's called before the function.

EDIT: Apparently, it's fixed.
Quote:

[22:09:11] Streaming: "http://yp.shoutcast.com/sbin/tunein-station.pls?id=656213"
[22:09:11] Listening to: "RADIOUP.COM - THE HITLIST - #1 FOR ALL HIT MUSIC"
[22:09:11] Playing: "Chris Brown - Fine China"
[22:09:16] Playing: "~+ (147) Radioup.com Sweeper +~ - ~+ (147) (fem) All The Hits! - The Hitlist Radioup.com +~"
[22:09:20] Playing: "Avril Lavigne - Here's To Never Growing Up"

Thank you.


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - ReVo_ - 07.07.2013

Audio_PlayStreamed returns an handle, maybe you should use the handle returned by Audio_PlayStreamed.

Код:
stock Function(playerid)
{
        Audio_Set3DPosition(playerid, Audio_PlayStreamed(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=656213", false, false, true)
, playerPos[0], playerPos[1], playerPos[2], 50.0);
    return 1;
}
try this


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

It's fixed, thank you anyway


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

I think the gamemode is having fun of me. It doesn't work anymore, what the fuck? Same error.

I tried your method ReVo_, but it doesn't work.


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - ReVo_ - 07.07.2013

I think the url is the problem, try with another url.


Re: Invalid handle, PlayStreamed with Set3DPosition (Incognito's Audio Plugin) - GiamPy. - 07.07.2013

Same error.

Quote:

[23:01:04] Error creating mixer for playback of "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1564322": Invalid handle