jeudi 2 décembre 2021

Converting Bytes read to seconds read of a .wav file

I am reading data from a Riff wav fmt file, I have an array of the data chunk DataBufferof the wav file, how can I convert the number of bytes read of the data to the number of seconds read from the wav file.

    int size_buffer = (Subchunk2Size / (NumOfChan * bitsPerSample / 8));
    
    FILE* WavResult = fopen(FileNom, "rb")

    u8* DataBuffer = new u8[size_buffer];
    
    size_t nRead = fread(DataBuffer, sizeof DataBuffer[0], size_buffer, WavResult);


Aucun commentaire:

Enregistrer un commentaire