first, excuse my for my bad english
I would like to send sound via the network, an i need some help, it’s my first time dealing with fmod so be tolerant :p
I’m programming in C, and i did this :
On the talker side : from the example of “write to file”, i think it is good idea :
sendto (exactly like fwrite.. i think..)
On the listener side : i have a problem :
// my buffer :
long buf[RECORDRATE /2];(i have tested with * too)
// my sample :
samp = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDRATE / 4, FSOUND_NORMAL , RECORDRATE, 255, 128, 255);
// Here i receive in the buffer : (it works, i receive the lenght of bytes i sent from the talker)
recvfrom(*sockreceveur, buf, (RECORDRATE/2) , 0,(struct sockaddr *)&blabla_addr, &addr_len)) == -1);
// Here i upload the buffer to the sample :
if (!FSOUND_Sample_Upload(samp,buf,FSOUND_16BITS | FSOUND_MONO | FSOUND_SIGNED))
// Here i play the sample :
channel = FSOUND_PlaySound(FSOUND_FREE, samp);
BUT sample_upload raise an error : An invalid parameter was passed to this function
I don’t find the reason Please can a generous roxor help me ?
Or also advice me on a better way to resolve my problem ?
thanks a lot
- invader asked 13 years ago
In fact, of course I have tested many things before to post my probleme in here, and yes the *buf is a garbage from those tests :p thx for alerting me on this problem
With * or not, the result is the same
// my buffer :
long buf*[RECORDRATE /2]; –> long buf[RECORDRATE /2];
any other idea please ?
hoo in fact maybe something is missing, and a propos i have a question :
my C program creates 2 threads with fork(), one for the talker, and one for the listener, do i need to put init for input and output in the talker code, and init for output on the listener code ?? well OK your answer make me understand this, i’ll try
Please login first to submit.