Answer the question
In order to leave comments, you need to log in
How to display the sound in the form of a C ++ openGl graph and a question on ifstream?
Well, I'm reading a wav file, drawing a broken line using openGl, it turns out somehow wrong =)
audiocoding.ru/article/2008/05/22/wav-file-structu... in the wav format documentation, reading starts from 44 bytes . And here at once a question I read a file means ifstream.
ifstream in;
in.open("F:\\sounds\\114835.wav", ios::binary); //открываю файл
in.seekg ( 44, ios::beg); //переход на 44 байт
unsigned short int ss; //переменная размером в 2 байта
in.read(reinterpret_cast<char *>(&ss), sizeof(ss)) //читаю по 2 байта сразу
in.seekg ( 44, ios::beg);//перейти на 44 байт ?
in.seekg ( 43, ios::beg);//или на 43 байт ?
in.read(reinterpret_cast<char *>(&ss), sizeof(ss))//он читает 44 байт включительно или нет ?
Answer the question
In order to leave comments, you need to log in
I will not edit the question, but here is my jamb
unsigned short int //я использовал
short int //а надо было это
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question