Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"... -s 256" fails. #7

Closed
drakpo opened this issue Aug 2, 2022 · 5 comments
Closed

"... -s 256" fails. #7

drakpo opened this issue Aug 2, 2022 · 5 comments
Assignees

Comments

@drakpo
Copy link

drakpo commented Aug 2, 2022

-s 128 and lower values work, but...

python3 main.py -i RESULTS/b.wav -s 256
Traceback (most recent call last):
File "/Users/AAA/Downloads/SOUND/audio-randomizer-master/main.py", line 98, in
wavedict = load_wave(vars.input, int(vars.splits))
File "/Users/AAA/Downloads/SOUND/audio-randomizer-master/main.py", line 64, in load_wave
wavedict['frames'] = split_frames(wavefile, splits, wavedict['duration'])
File "/Users/AAA/Downloads/SOUND/audio-randomizer-master/main.py", line 50, in split_frames
wavefile.setpos(int(frame_position))
File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/wave.py", line 229, in setpos
raise Error('position not in range')
wave.Error: position not in range

@piscue
Copy link
Owner

piscue commented Aug 2, 2022

I see the point and I would love to understand the use case. You wanna really create a very randomized file? Could you explain a bit?

For now I can capture the exception and print a better message

@piscue
Copy link
Owner

piscue commented Aug 2, 2022

With the latest merge, you should be able to increase the number of the splits as much as you want, in a decrease skipping the last splits on the file, creating a "slightly" smaller output file.

Let me know if that fixes your use case, and still curious about the use of this tool from your side

@drakpo
Copy link
Author

drakpo commented Aug 2, 2022

that is exactly what I want to do. was doing this with PyDub's AudioSegment, but was wanting to see if your version, without the library, could do it. will try this version.

@piscue
Copy link
Owner

piscue commented Aug 2, 2022

with this version I can also increase a lot the number of splits 131072, increasing the waiting time for the output, and create a very interesting "noise" with a very scrambled file

docker run -v ~/Downloads:/wav piscue/audio-randomizer -i /wav/test_randomizer.wav -s 131072

@piscue piscue removed the help wanted Extra attention is needed label Aug 2, 2022
@drakpo
Copy link
Author

drakpo commented Aug 2, 2022

all works here, now, thank you.

@drakpo drakpo closed this as completed Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants