Log in to Freesound

Problems logging in?
Don't have an account? Join now

Problems logging in?

Enter your email or username below and we'll send you a link to help you login into your account.

Back to log in

Almost there!

We've sent a verification link by email

Didn't receive the email? Check your Spam folder, it may have been caught by a filter. If you still don't see it, you can resend the verification email.

Default title

  • Sounds
  • Tags
  • Forum
  • Map
    • Sounds
    • Packs
    • Forum
    • Map
    • Tags
    • Random sound
    • Charts
    • Donate
    • Help

Freesound Forums

  • Freesound Forums
  • Freesound Project
  • Waveform sound image

Waveform sound image

Subscribe

Started September 19th, 2006 · 49 replies · Latest reply by HardPCM 17 years, 8 months ago

M
mindead

0 sounds

5 posts

19 years, 3 months ago
#1

Hello all,

I have a technical question regarding the website and the project.

I am a programmer and I would like to generate the same waveform representation as you do for every sounds in the database.
Could you point me exactly to the framework you are using to generate it? Is this part of your website is GPL or something?
I would like to pass a sound to a program that will directly create the PNG file on disk and load it in a database.

Thank you very much for any help on this.

Jean-Philippe

For those who are interested,
I am starting a research on the utilization of graphical representation of sound files to enable Content-Based Retrieval (CBR) in a database.

Jean-Philippe
Bram

122 sounds

1,573 posts

19 years, 3 months ago
#2

it's a utility we made ourselves, and released under GPL afterwards:

http://freesound.iua.upf.edu/files/wav2png.tar.gz

have fun!

- bram

Admin | Support
M
mindead

0 sounds

5 posts

19 years, 3 months ago
#3

Thank you so much for the quick and useful response!
That will save me a lot of time.

I have tried to compile the code and I have a strange C error which I don't understand well..
I know its not a C forum, so if you have the compiled version, that would be useful.
I'm running an up-to-date ubuntu dapper with development libraries you specify in the file.

phil@cordelia:~/wav2png$ make all
g++ -c -O2 -Wall -pedantic main.cpp
main.cpp: In function ‘long int string2color(std::string, gdImage*)’:
main.cpp:75: error: no matching function for call to ‘transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unknown type>)’
make: *** [main.o] Error 1

Phil

Jean-Philippe
Bram

122 sounds

1,573 posts

19 years, 3 months ago
#4

try changing "lower" to std::lower( ) on line 75
tell me if that works

- bram

Admin | Support
M
mindead

0 sounds

5 posts

19 years, 3 months ago
#5

Tried several combinations:

std::tolower
tolower
std::tolower()
tolower()

same error about parameters...

Jean-Philippe
M
mindead

0 sounds

5 posts

19 years, 3 months ago
#6

Tip if you want to make this code portable:
line75 should be:
std::transform(s.begin(), s.end(), s.begin(), (int(*)(int))std::tolower);

it works now, but it would be nice to have the color file you have that is not included in the package...

thanks!

Jean-Philippe
Bram

122 sounds

1,573 posts

19 years, 3 months ago
#7

the colorfile is generated by another program, which I sadly enough can't give you...
but if you would like to know, the color is created by taking a 256-size FFT and calculating the spectral centroid for the current location.

the format of the file isn't very hard to mimic:

[128]
45.5662
46.4447
45.852
46.1478
47.4766
46.0987
45.6384
...

That's it, basically

cheers,

- bram

Admin | Support
M
mindead

0 sounds

5 posts

19 years, 1 month ago
#8

Unfortunately, I'm not very familiar with DSP yet.
Do you mean you create a color file for every sound?

Do you know any website introducing the subject.
Or do you know any Open Source program that would do the same?

Jean-Philippe
Bram

122 sounds

1,573 posts

19 years, 1 month ago
#9

mindead
Unfortunately, I'm not very familiar with DSP yet.
Do you mean you create a color file for every sound?

Do you know any website introducing the subject.
Or do you know any Open Source program that would do the same?

Hmm, you'll have a lot to learn!

Try figuring out how you can use FFTW (google!) to generate spectrums of a sound. After that have a look at libsndfile (google!! wink) to load waveforms. After that, patch the two together, figure out how to make a "spectral centroid" and you're on your way.

And if you want a good reference for doing all of this, have a long look at: http://www.dspguide.com/pdfbook.htm

- bram

Admin | Support
J
JDude

0 sounds

1 post

18 years, 6 months ago
#10

Hello,

When I've tried to install/compile the main.cpp file, I get this error:
------------------------------------
g++ -c -O2 -Wall -pedantic anyoption.cpp
g++ -c -O2 -Wall -pedantic main.cpp
sndfile.h:253: error: '__int64' does not name a type
sndfile.h:263: error: 'sf_count_t' does not name a type
sndfile.h:316: error: 'sf_count_t' does not name a type
sndfile.h:317: error: 'sf_count_t' does not name a type
sndfile.h:389: error: ISO C++ forbids declaration of 'sf_count_t' with no type
sndfile.h:389: error: typedef 'sf_count_t' is initialized (use __typeof__ instead)
sndfile.h:389: error: 'sf_vio_get_filelen' was not declared in this scope
sndfile.h:389: error: expected ',' or ';' before '(' token
sndfile.h:396: error: 'sf_vio_get_filelen' does not name a type
main.cpp: In function 'long int string2color(std:weirdtring, gdImage*)':
main.cpp:75: error: no matching function for call to 'transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unresolved overloaded function type>wink'
main.cpp: In function 'int main(int, char**)':
main.cpp:633: error: 'struct SF_INFO' has no member named 'frames'
main.cpp:639: error: 'struct SF_INFO' has no member named 'frames'
make: *** [main.o] Error 1
------------------------------------

Any help would be appreciated, of somebody has an idea?
Thanks in advance.

A
andrew1280

31 sounds

24 posts

18 years, 3 months ago
#11

For those who are interested,
I am starting a research on the utilization of graphical representation of sound files to enable Content-Based Retrieval (CBR) in a database.

That is a fascinating project. If you can create a fast, lightweight way to accomplish your goal, you will be quite the revolutionary. I imagine that many people would want to have that resource, and even more to be able to use it. Don't give up!

digifishmusic

614 sounds

274 posts

18 years, 3 months ago
#12

Bram
it's a utility we made ourselves, and released under GPL afterwards:

http://freesound.iua.upf.edu/files/wav2png.tar.gz

have fun!

- bram

I produced this last year just so I could have fun with it smile

http://freesound.iua.upf.edu/samplesViewSingle.php?id=22714

Nice feature.

H
hello_flowers

785 sounds

273 posts

18 years, 3 months ago
#13

hehe. when I go to http://freesound.iua.upf.edu/files/ it says "you shouldn't be here..." in times new roman/ tongue

anyways, Audacity lets you export a txt file of the spectrum, but then you'd have to copy and paste all the values manually, which isn't that convenient.

SQUID KING REVIVAL
lonemonk

159 sounds

204 posts

18 years, 3 months ago
#14

I've asked this before, but I would love to run freesound In-house as as my media management system. I would still contribute to this site where I can, but a majority of the stuff I record is owned by other people explicitly. I still however need a way to categorize and search recordings of my own just like we do in here.

Ever notice there are NO audio-focused media management softwares out there? (Except for programs like iTunes which are a fucking joke compared to what I'm talking about)
There are lots of image/movie/book collection Databases, but they do not translate well.

Without getting into the other topic around here about how to keep the site going from within the current scenario, could not MTG spin off the code that runs Freesound and sell the architecture to other organizations/people? The website looks as though MTG does sell various technologies that Freesound has built into it, but not a system which could be used as one.

That's my rant for today.

H
hello_flowers

785 sounds

273 posts

18 years, 3 months ago
#15

http://findsounds.com/

they have a program that can allow you to search both the internet AND/OR local files, for sounds based on tags, (ie. you tag your local files in a way I'd assume is similar to freesound. but it's not freeware.... those frikkers............................

SQUID KING REVIVAL
H
HardPCM

0 sounds

215 posts

18 years, 3 months ago
#16

andrew1280
For those who are interested,
I am starting a research on the utilization of graphical representation of sound files to enable Content-Based Retrieval (CBR) in a database.

That is a fascinating project. If you can create a fast, lightweight way to accomplish your goal, you will be quite the revolutionary. I imagine that many people would want to have that resource, and even more to be able to use it. Don't give up!

hummmm!!

I'thinkink I will make one for you people :twisted:

H
HardPCM

0 sounds

215 posts

18 years, 3 months ago
#17

...that will working!!!

H
HardPCM

0 sounds

215 posts

18 years ago
#18

Like I said, :roll: (three month ago),
I success to make a workable Win32 version of Wav2Png.Exe on MSVC (Visual C++) v6.0
(in 2 hours, OMG)

If Bram would make it available for everyone (Src & Exe),
just ask for it,
and he may put it in the famous "http://freesound.iua.upf.edu/files/"

tongue tongue tongue tongue tongue
tongue tongue tongue tongue tongue
tongue tongue weirdhock: tongue tongue
tongue tongue tongue tongue tongue
tongue tongue tongue tongue tongue :lol:

After I must think about how to make
the spectral centroiD with the famous FFTW,
:evil:, help!

Bram

122 sounds

1,573 posts

17 years, 11 months ago
#19

hello hardpcm, if you send me a ZIP with the needed sources etc I'll gladly put it up.

spectral centriod: http://en.wikipedia.org/wiki/Spectral_centroid

- bram

Admin | Support
Bram

122 sounds

1,573 posts

17 years, 11 months ago
#20

Hello Everyone,

prompted by HardPCM and many others I've decided to release wav2png like I should have released it quite a while ago:

http://code.google.com/p/wav2png/

I've made some changes in the source code so it builds without problems in msvs2005, taking into account some of the problems reported to me in the past.

HardPCM: please send me an updated wav2png.dsw / wav2png.dsp for visual studio 6 (only these two files are needed!) so I can add it. Make sure all directories are RELATIVE and not absolute.

For those who need it, the linux build script is being looked at.

- bram

Admin | Support
Post reply
  • 1
  • 2
  • 3
About Freesound Terms of use Privacy Cookies Developers Help Donations Blog Freesound Labs Get your t-shirt!
© 2025 Universitat Pompeu Fabra