how do you convert raw data back to a sound. in between the sound lock and unlock what do i do to get the sound out I tried memcpy
m_VoiceSound->getLength (&lenbytes, FMOD_TIMEUNIT_PCMBYTES);
m_VoiceSound->lock(0, lenbytes, &ptr1, &ptr2, &len1, &len2); memcpy(ptr1,data,len1); m_VoiceSound->unlock(ptr1, ptr2, len1, len2);
but i get memcpy assembly error.
what I would like to do is get the raw data out of the sound and store it in a char * then send that pointer across the network and reconvert it to a sound again can anyone help
- polemos asked 11 years ago
if you are copying [b:jyrx2m9x]to[/b:jyrx2m9x] data, then your memcpy should be data,ptr1 not ptr1,data.
Also did you allocate memory for the data pointer? It looks like you’re just copying to an invalid pointer there, its not pointing to anything.
Thanks for the help brett I really appreciate it. That was a typo with the memcpy sorry. But I have another question. Say you have 5 seconds of audio that you specified with the create exinfo structure to be 8000 hzt, but I have limitations with the netcode packets being sent to 1000 bytes how can I send 5 secs of audio with a limitation of 1,000 bytes can I compress it more or stream it do you have any suggestions on this, also when I send it to the client how do I convert that raw data back to a sound.
- polemos answered 11 years ago
Please login first to submit.