2018-10-05 10:52:13

Hello
I recently used sound_lib in a python project of mine in order to play sounds.
It works perfectly fine, with no errors, when it is in its raw, .py form. When I use pyinstaller on it though, and copy in the folder sound_lib, or even when it is just run on its own with no --onefile attached, I get the following error:
Error: the sample buffer was lost.

My code for doing this is below:
    handle=stream.FileStream(file=full)
    lastplayed=full
    handle.looping=False
    global volume
    handle.set_volume(volume/100)
    handle.play()

Thanks for any help you can provide

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2018-11-10 16:56:39

Speaking of soundlib. I can find 0 documentation about how the thing actually works. Anyone know if there's like a simple function reference?

Much less active on this forum than in the past.

Check out my live streams: http://lerven.me
follow me on Twitter: http://twitter.com/liamerven

2018-11-10 18:15:11

@2 actually you could use dir() in the classes that you will need that are FileStream, output, and channel for the basic stuff. Or you can just explore it's source if you feel confortable with it.
The channel class is in sound_lib/channel.py, the output is in output.py and the stream is in stream.py.

Paul

2018-11-18 06:58:09

The easiest way to use sound_lib is with the game_utils.sound module. (Game_utils also includes classes for menus, cut-scenes and the like.)

#FreeTheCheese
"The most deadly poison of our times is indifference. And this happens, although the praise of God should know no limits. Let us strive, therefore, to praise Him to the greatest extent of our powers." - St. Maximilian Kolbe

2018-11-18 19:12:59

yeah. I would, but I can't get it to compile into the actual EXE using pyinstaller, which makes its usage all but useless

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2018-11-19 06:38:39

As for soundlib, I had to learn it all myself, which was relatively easy given the fact I knew how bass worked already.

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me

2018-11-19 18:15:48

@6
Yeah. I manjaged to teach myself most of it, though I freely admit to having a helping hand to get me started from a friend of mine. The dir() command is wonderful in python.
I must wonder if it is something in my code, perhaps? because googling this issue, where I use pyinstaller to turn the python program into an exe file does not seem to ever occur.

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2018-11-19 22:20:44

You will have to make pyinstaller not pack the files into the executable in order to make sound_lib work correctly. Not sure on the exact command for this.

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me

2018-11-20 10:13:51

where do I get soundlib and gameUtils etc etc?

ReferenceError: Signature is not defined.

2018-11-20 20:02:49

Really? I think it does it even without onefile to be honest, but don't quote me on that.

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2018-11-21 22:49:15

It didn't when I tried it last.

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me

2018-11-21 23:16:07

@masonian
You can use both AO2 and sound_lib in a frozen one-file executible, however the libs have to be placed along-side your app. The procedure is as follows

First, delete c:\python36\lib\site-packages\pyinstaller\hooks\hook-accessible_output2 and hook-sound_lib.py
These, in fact, are more a hinder than help it turns out. thanks a lot relative paths.

Next, cd to your project irectory and run

pyinstaller --onefile --windowed (... whatever flags here) script.py

This will create a dist directory with your scripts executable, which will complain after running. Now comes the most tedious part, but once it's done you won't have to worry about it. Copy the sounds directory and any other requirements to dist. Now you'll have to copy the bass and screen reader DLL's
Copy these directories into dist as well. c:\python36\lib\site-packages\accessible_output2 and c:\python36\lib\site-packages\sound_lib. Returning to dist, open accessible_output2 and sound_lib's directories an feel free to delete everything other than lib

Let me know if more explanation is necessary here

2018-11-22 17:23:10

Hey @cartertemm
I followed your steps, converting to python 2.7 because that is what I am using, and still get the error from post 1.

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!