|
Post by nathanmyersc on Mar 28, 2024 1:09:57 GMT
It might be better to scale the image down to like 100x100 or something and loop over that in the WAV instead of doing it to 1 sample. That might play fast enough the whole image to make the energy work. The image to WAV I created took your marijuana image and made a 50 min or so WAV. You should scale it down by 0.5x or something that conserves aspect ratio instead, so data isn't crushed. And you could speed the file up, 2x, 4x (even 8x). You could speed up the sampling rate. and it would read the data faster. the max sampling rate that you can get some audio players to play is 767500 tho
|
|
|
Post by reden on Mar 28, 2024 1:47:44 GMT
You should scale it down by 0.5x or something that conserves aspect ratio instead, so data isn't crushed. And you could speed the file up, 2x, 4x (even 8x). You could speed up the sampling rate. and it would read the data faster. the max sampling rate that you can get some audio players to play is 767500 tho By speed it up I meant accelerate the speed, for example in youtube when you click on the cog then "Playback speed 1x 1.25x 1.5x 1.75x 2x", what is called in ffmpeg "atempo". Remember that while you can make sampling rate very high, not everything can play it. Most standard/typical sound cards only do up to 48000 Hz, with some fancier speakers doing up to 96khz, but higher than that is basically reserved to DACs, even USB ones (HiFi audio equipment) and so forth.
|
|
|
Post by nathanmyersc on Mar 28, 2024 2:41:52 GMT
It might be better to scale the image down to like 100x100 or something and loop over that in the WAV instead of doing it to 1 sample. That might play fast enough the whole image to make the energy work. The image to WAV I created took your marijuana image and made a 50 min or so WAV. I gave it a shot give it a try.
|
|
|
Post by AnthroHeart on Mar 28, 2024 9:20:34 GMT
It might be better to scale the image down to like 100x100 or something and loop over that in the WAV instead of doing it to 1 sample. That might play fast enough the whole image to make the energy work. The image to WAV I created took your marijuana image and made a 50 min or so WAV. I gave it a shot give it a try. I made a few updates to your code:
1) Asking user for the sampling rate and writing the .wav file with the sampling rate on it for comparing. 2) Alternating between negative and positive values for a sample (indicating in and out of speaker) for more dynamic range. 3) Set to 32-bit audio for highest quality.
Do we need to convert the .jpg to BMP first so we're actually using pixel data, instead of some compressed version of it?
|
|
|
Post by AnthroHeart on Mar 28, 2024 10:48:19 GMT
I used Cody AI extension to help me update the code. You can ask questions of your codebase in the whole folder. It requires logging in to your github or google. But it is my favorite coding helper when I'm not using Claude 3 or GPT-4 directly.
This is useful (though I just use the GPT-4 default with Cody, which is free for a certain number of uses)
It can be added in as Visual Studio Code extensions.
|
|
|
Post by nathanmyersc on Mar 28, 2024 14:16:58 GMT
I gave it a shot give it a try. I made a few updates to your code:
1) Asking user for the sampling rate and writing the .wav file with the sampling rate on it for comparing. 2) Alternating between negative and positive values for a sample (indicating in and out of speaker) for more dynamic range. 3) Set to 32-bit audio for highest quality.
Do we need to convert the .jpg to BMP first so we're actually using pixel data, instead of some compressed version of it?
I made some improvements of our code. 32 bit version has much larger amplitude range. and i made it so user can input amount of channels. and made it so user can choose 2 amplitude width or 4 amplitude width
|
|
|
Post by nathanmyersc on Mar 28, 2024 14:17:30 GMT
I used Cody AI extension to help me update the code. You can ask questions of your codebase in the whole folder. It requires logging in to your github or google. But it is my favorite coding helper when I'm not using Claude 3 or GPT-4 directly.
This is useful (though I just use the GPT-4 default with Cody, which is free for a certain number of uses)
It can be added in as Visual Studio Code extensions. aw makes me wish i used visual studios. can i install my own compiler and use it i use gcc 13.2 atm.
|
|
|
Post by AnthroHeart on Mar 28, 2024 14:19:56 GMT
I made a few updates to your code:
1) Asking user for the sampling rate and writing the .wav file with the sampling rate on it for comparing. 2) Alternating between negative and positive values for a sample (indicating in and out of speaker) for more dynamic range. 3) Set to 32-bit audio for highest quality.
Do we need to convert the .jpg to BMP first so we're actually using pixel data, instead of some compressed version of it?
I made some improvements of our code. 32 bit version has much larger amplitude range. and i made it so user can input amount of channels. and made it so user can choose 2 amplitude width or 4 amplitude width What is amplitude width? Does 4 mean 32-bits, and the others mean lower bits?
|
|
|
Post by AnthroHeart on Mar 28, 2024 14:20:38 GMT
I used Cody AI extension to help me update the code. You can ask questions of your codebase in the whole folder. It requires logging in to your github or google. But it is my favorite coding helper when I'm not using Claude 3 or GPT-4 directly.
This is useful (though I just use the GPT-4 default with Cody, which is free for a certain number of uses)
It can be added in as Visual Studio Code extensions. aw makes me wish i used visual studios. can i install my own compiler and use it i use gcc 13.2 atm. Yes. I don't compile c++ inside visual studio. I save it and compile it command line separately.
|
|
|
Post by nathanmyersc on Mar 28, 2024 14:21:34 GMT
I made some improvements of our code. 32 bit version has much larger amplitude range. and i made it so user can input amount of channels. and made it so user can choose 2 amplitude width or 4 amplitude width What is amplitude width? Does 4 mean 32-bits, and the others mean lower bits? Totally amplitude width is what i call the value that corresponds to a sample. i guess i could call it sampleWidth. 4 means 32-bits yeah 8 bits to a byte. I changed it so we were using the whole 32 bits because the 32767 is only for 2 bytes not 4.
|
|
|
Post by AnthroHeart on Mar 28, 2024 15:30:31 GMT
I'm not sure if this will be useful to you, but this github repo has a python program that can generate white, pink, blue, brown and violet noise. It may help you create something more soothing if you want for your program. github.com/scivision/soothing-sounds
|
|
|
Post by reden on Mar 28, 2024 16:44:00 GMT
|
|
|
Post by AnthroHeart on Mar 28, 2024 16:54:52 GMT
I personally prefer brown noise the most, and sometimes pink noise.
|
|
|
Post by sound on Mar 28, 2024 21:43:14 GMT
I remember reading a study with that conclusion and it was sponsored by some competing binaural beats company or similar. I don't know if this is the one.
|
|
|
Post by AnthroHeart on Mar 29, 2024 0:06:47 GMT
What is amplitude width? Does 4 mean 32-bits, and the others mean lower bits? Totally amplitude width is what i call the value that corresponds to a sample. i guess i could call it sampleWidth. 4 means 32-bits yeah 8 bits to a byte. I changed it so we were using the whole 32 bits because the 32767 is only for 2 bytes not 4. I updated your code to allow you to specify the # of samples/steps between each sample value, from two neighboring pixel values.
So it doesn't jump between sample values faster than the speaker can respond.
It defaults to 1, which shouldn't change what you have.
I tried 10 steps and 100 steps for interesting results. So it's more graceful in going between pixel values. You might want to check the code.
|
|