0
0

Hello all ๐Ÿ˜‰

How can I make a waveform same of that :
[img:gf6p6sep]http://thomastortorini.free.fr/bazar/waveform.jpg[/img:gf6p6sep]

[img:gf6p6sep]http://thomastortorini.free.fr/Projets/Player21/Release_3/Deck_(partie_principale).jpg[/img:gf6p6sep]
In this picture you can see one part of my projet and you can see a small waveform, this waveform is the complete music, I create this with an other stream and every 25ms I take a spectrum…
8s for create this waveform every time you load a music.

But now I want a waveform of 10secondes (or 8 or 6) of my music and this waveform must move every 25ms…

I read all topic about waveform I understand maybe I must to use [b:gf6p6sep]FMOD_Sound_ReadData[/b:gf6p6sep].

Please help me. ๐Ÿ˜ฅ

Thanks

PS: I’m french very sorry for my bad english…

EDIT: I forget: In my program I put the music in memory [b:gf6p6sep]FMOD_System_CreateSound[/b:gf6p6sep] is not a stream.

  • You must to post comments
0
0

I think you want to use Channel::getWaveData to display your waveform. That is what it is there for.

  • You must to post comments
0
0

Group/System/Channel::getWaveData and ::getSpectrumData

Example:
http://www.yoyogames.com/games/launch/34365

Keep the data fetching low. 64 to 128 entries is about what you need (visually)

The top image in your example is the wave data.

you can draw the -1 to 1 values easilly value*height+y. You may need to make sure the values are whitin -1 to 1. I played files in older versions of FMOD when I would get garbage values beyound that range

the bottom is spectrum. You will need to normalise the data to display it as it explains in the help file. values are from 0 to 1 and can be very tiny (hence the need to normalise).

[edit]
Oops, the bottom is not quite what I was thinking… It’s the entire file yes?

  • You must to post comments
0
0

You cannot use channel->getWaveData() because you also want to diplay the waveform in the future. Use sound->readData(). For each block of x samples store the maximum value for left and right channel or use some other method like averages or something. I think all DJ apps prescan the file, calculating the waveform on-the-fly would be too expansive. You can also try sound->lock() but I don’t think it would give you good performance.

  • You must to post comments
0
0

Thanks [b:12978ntq]brett[/b:12978ntq], [b:12978ntq]icuurd12b42[/b:12978ntq] & [b:12978ntq]mylo[/b:12978ntq] for reply. ๐Ÿ˜‰

@[b:12978ntq]brett[/b:12978ntq]: I learn again the fonction [b:12978ntq]getWaveData()[/b:12978ntq] and I test with 16384 and I compressed the picture but it’s not what I want :( mylo say exactly my problem.

@[b:12978ntq]icuurd12b42[/b:12978ntq]: Your program show lot off visualisations, good, but it’s not what I want…

@[b:12978ntq]mylo[/b:12978ntq]: Yes I read lot off thing about [b:12978ntq]readData()[/b:12978ntq] and [b:12978ntq]lock()[/b:12978ntq] but I don’t know how I can use it ๐Ÿ˜•
If you can post me (in this topic for all) a simply code it will be very cool because I don’t speak english, I don’t understand the function, and I don’t find help in the web (except here).

  • You must to post comments
0
0

Take a look at the offlinedecoding example in your fmod examples directory. Instead of writing the read data out to a file, scan the read data and store the peaks for each channel.

  • You must to post comments
0
0

Thanks [b:4ua2re8e]mylo[/b:4ua2re8e]

I understand the code in offlinedecoding example but I don’t know how I can do what I want…

I try this : (but I don’t know what I receive, I don’t know what I must receive :( )

[code:4ua2re8e]#define CHUNKSIZE 8192
void *data = malloc(CHUNKSIZE);
unsigned int read, cursor;
FMOD_Channel_GetPosition(chan_deck[deck], &cursor, FMOD_TIMEUNIT_PCMBYTES);

FMOD_Sound_SeekData(sound_deck[deck], cursor – (CHUNKSIZE / 2));
FMOD_Sound_ReadData(sound_deck[deck], (char *)data, CHUNKSIZE, &read);[/code:4ua2re8e]

I am really really lost…

How I can use my "[i:4ua2re8e]data[/i:4ua2re8e]" ?

You know when I create a spectrum is very simply because I have a "tab" (float tab[1024]) is very simply to use it.
But with a buffer I’m lost…

I must use FMOD_Sound_SeekData() no ?

I think I ever succeed…

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.