Generate png from audio waveform
-
undergroundsurface undergroundsurface https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=311989
- KVRist
- 44 posts since 7 Sep, 2013 from Lithuania
It's more programming question actually. After googling a lot I've found this: https://github.com/jasny/audio
Yeah, but it requires javascript integration or whathever, I don't need that. I haven't found any info about configuring these php libraries with sox or installing that. If someone could help me, I would be very grateful.
Another question is more simple. What could be alternative ways to generate image png from an audio file, it doesn't matter if it's wav or mp3? Audacity can do print waveform.
Another thing that I've found is Sonic Visualizer, which is capable of exporting pngs from an audio file. But unfortunately it's buggy a bit and not suitable for batch conversion. Console applications can do that. Maybe this question would be difficult for someone, but I think someone should know something.
Yeah, but it requires javascript integration or whathever, I don't need that. I haven't found any info about configuring these php libraries with sox or installing that. If someone could help me, I would be very grateful.
Another question is more simple. What could be alternative ways to generate image png from an audio file, it doesn't matter if it's wav or mp3? Audacity can do print waveform.
Another thing that I've found is Sonic Visualizer, which is capable of exporting pngs from an audio file. But unfortunately it's buggy a bit and not suitable for batch conversion. Console applications can do that. Maybe this question would be difficult for someone, but I think someone should know something.
- KVRAF
- 12615 posts since 7 Dec, 2004
Why does it need to be png?
Drawing your own bitmap graphics is relatively simple, as is exporting them in a compatible format like ARGB TGA which you can then convert to png if desired.
The real question is exactly what do you want to draw? There is no one "correct" method to visualize a signal and this really leads you to the subjective as it's no different than asking "how do you paint a landscape?"
Are you asking about existing libraries or are you interested in rolling your own?
Such a project requires at minimum a few components such as:
Drawing your own bitmap graphics is relatively simple, as is exporting them in a compatible format like ARGB TGA which you can then convert to png if desired.
The real question is exactly what do you want to draw? There is no one "correct" method to visualize a signal and this really leads you to the subjective as it's no different than asking "how do you paint a landscape?"
Are you asking about existing libraries or are you interested in rolling your own?
Such a project requires at minimum a few components such as:
- Bitmap object
- RIFF or other signal format support
- Drawing routines for lines and such
- Color object with gamma functions and such to manage colors
- TGA or other bitmap format support for export
- Processing to actually convert between the signal and bitmap graphics
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRist
- 111 posts since 22 Jul, 2010
Yes there can be a variety of ways to convert a sound into image (and vice-versa), depending on your objective. You could for example:What could be alternative ways to generate image png from an audio file
Encode a sound as a grey-scale png. Each sample value can be represented as a pixel of a 8/16/24 bit grey colour. To create the image scan left to right for a set number of samples, then for the next row start again from left and go right for the same number of samples, and so on, like picture tube scanning. So, just over a 6 second sound sampled at 44.1kHz may be represented as a 700x400 pixel grey-scale image for instance. Easy enough then to scan the image back into sound. Play around with a variety of image effects and filters while the sound is encoded as an image and see what it does to the sound. The storage size in kB of the .png file may well be less than an equivalent .wav file.
-
- KVRist
- 56 posts since 24 Feb, 2013
If you can program in code (say masm for example) it could be as simple as grabbing the audio data from the wav file and then chucking a PNG header on it, obviously you could also perform various tasks on the data to fill the PNG header fields in different ways
- KVRist
- 275 posts since 24 Feb, 2015
Ocenaudio editor also has a waveform snapshot function. It's freeware
Download & play soothing music: https://soundcloud.com/wait_codec