Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const int waveDataSize = record_time * 88000; #2

Open
MichaelVLV opened this issue Jun 13, 2018 · 7 comments
Open

const int waveDataSize = record_time * 88000; #2

MichaelVLV opened this issue Jun 13, 2018 · 7 comments

Comments

@MichaelVLV
Copy link

MichaelVLV commented Jun 13, 2018

Hello,

What is meaning this constants at .ino file 88000 and 8000?

const int waveDataSize = record_time * 88000;
const int numCommunicationData = 8000;

Is it somehow belongs to sample rate 44100 Hz @ 16bits?

@aarotronics
Copy link

Hi,

how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

@SinanAkkoyun
Copy link

Hey, I tested it and he made a typo. I think its supposed to be 44100 * 16 * 1 / 8 (44100 hz, 16 bit and 1 channel), 88200.

If I record with 88000 my files get ever so slighty shorter.

@SinanAkkoyun
Copy link

Hi,

how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

@SinanAkkoyun
Copy link

Hi,
how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

Then you have to change the for loop to a while(button not pressed)

@IPARTH10
Copy link

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

Hi Brother, I read it and implement this in my code but I am getting some errors. So can you please add this feature to your code and then finally send me the code with this feature added in it.

@nicorenaldo
Copy link

44100 * 16 * 1 / 8

Hey, what does the '8' represents ?

@ceperman
Copy link

ceperman commented Oct 29, 2024

The number of bits in a byte.

44100 * 16 * 1 / 8 is the number of bytes/second produced (sample rate * bits per sample * number of channels / bits per byte)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants