bkacjios / lua-mumble

A lua module to connect to a mumble server and interact with it
MIT License
23 stars 4 forks source link

client:play() arguments? #2

Closed A-Cloud-Ninja closed 4 years ago

A-Cloud-Ninja commented 5 years ago

So I know you don't support this anymore really, and it seems like you're making Lumble, to be better and whatnot, but I stumbled on this and wanted to use it. I got most of it down, but your documentation for client:play seems to be wrong unfortunately. mumble.client:play(String ogg file path) is the string you document, but giving it a direct path to the .ogg doesn't work, as it expects a number for arg #2.

A-Cloud-Ninja commented 5 years ago

For example, i run the code client:play("/home/cloud/Documents/Lua/Bot/SONG.ogg",0.5) and all I get back is nil error opening file 0.5: unknown error

A-Cloud-Ninja commented 5 years ago

So A) I figured out that your error handling in the C function responsible for play is taking the wrong argument, and B) Playback of ogg vorbis ripped via youtube-dl seems to be slowed down and pitched down via the bot somehow.

bkacjios commented 5 years ago

Sorry for the late reply, I literally didn't get any notifications for this issue report.

The arguments that it checks are correct. The first argument is technically the client being passed to itself. It's how Lua handles "self"

client:play("somefile.ogg") and client.play(client, "somefile.ogg") do the same exact things.

So I'm checking for the client, then the file, then optionally volume.

The pitch issue is because I don't do any audio resampling. Make sure the audio file is at 48000Hz bitrate and it should play normally.