feature request: channelpitchplaying
Blitz3D Forums/Blitz3D Programming/feature request: channelpitchplaying
| ||
or something similar... I'm trying to do some basic lip synching. I have a robotic character and all I need is for his mouth plate to flash on/off in time to the wave file. Can't use random flashes as there are pauses/quiet points in speech. Instead I have to precalc somekind of timing data, which is time consuming. If there was a channel_pitchplaying then I could simply tie the mouth plate colour to that. Would save a lot of time. Could even be used, perhaps, for some basic articulated mouth animation. |
| ||
Pitch of a wav is very difficult to calculate, certainly in real time as you need a band of samples to work it out. Volume is slightly easier as you've just to take an average of the last x samples [abs(for the zero point)]. There are VU meters in fmod, but blitz currently isn't supporting them. Full fmod support would be brilliant, so I totally agree with this... to a certain extent at least. |
| ||
Hi Folks, so I totally agree with this... to a certain extent at least Hmmmm. Later, Jes |
| ||
Perhaps the bass.dll could be of some use. I don't have a link, but I remember using it last year for some VU meter stuff in blitz. Perhaps someone got the link. |
| ||
You gotta pay with the bass.dll though. |
| ||
Ah, I didn't know that, I used it for some tech demo stuff, you know Amiga like demo with effects reacting to sound. It would have been nice if more of the fmod features were available internally in blitz. I would assume then that using the fmod dll as an extension on blitz would require payment to the maker as well then? |
| ||
Not sure... That'll be an Fmod/Mark question. |
| ||
I am currently wrapping FMOD for blitz and I've already got the VU meter and the Spectrum DSP working in blitz. And you can even create your own samples! :) If anyone is interested then I will release the DLL when I'm finished. |
| ||
I guess you can read the sampling rate and the sampling bit resolution etc. in the wav file header. The rate is also the pitch, this will let you calculate the speed the sound is played. If I completely missed the point and you are after something diffrent like pitch detection (to recognize a note) then you might use other tricks like frequency recognition by amplitude characteristics and so on. |
| ||
Jfk/others Thanks for the ideas all. My solution has been to save the wave file as an ascii integer mono numeric file from Goldwave, then run it through a script that strips it down to 15 samples per sec (from its original 11025 per sec) and spits out a line of data statements. Still a bit munty though - somekind of in game option would be much more convenient Papa Lazarou FMOD dll - that sounds pretty interesting - would be interested in checking that out. |
| ||
I've been asking for this feature for ages, to get closer to lip-syncing. Yeah, the bass.dll costs a fortune if you want to actually release anything commercially. Essentialy I want to a) check each character each loop b) get the amplitude of the currently playing wave file for that character c) rotate the jaw an appropriate amount. Most of that is straightforward, the only difficulty is getting the current amplitude from a currently playing wavefile, and if you can do that Papa Lazarou then yes please, keep working on this and we would be forever in your debt (or even possibly pay you money). |
| ||
I think there is an easier way to do this quickly, as follows: (1) Write a routine which stores your mouse clicks into a bank - it would play the sound sample as it records your clicks. (2) Click your mouse clicks in time to the sound - as best you can to match the sync. (3) use the bank data to open and close the mouth plate. Job done. For a robot this will be fine I think. :) IPete2. |