E
E
Evgeny Petryaev2020-02-16 22:20:49
C++ / C#
Evgeny Petryaev, 2020-02-16 22:20:49

How to read the structure with such a file opening?

The structure itself:

struct WavFmt
{
    unsigned short encoding;
    unsigned short channels;
    unsigned int   frequency;
    unsigned int   byterate;
    unsigned short blockAlign;
    unsigned short bitsPerSample;
};

file open method
#ifdef _WIN32
 life=open(filename,_A_ARCH);
      if (life == -1) 
                        {
        printf("Open failed on input file: %s\n", filename);
#ifdef _WIN32
        wchar_t path[MAX_PATH];
        GetCurrentDirectory(sizeof(path),path);
        //std::string path_in_string = path;
        std::wcout << path/*path_in_string.c_str()*/ << std::endl;
#endif // _WIN32
      }
#else
        life=open(filename,O_RDONLY);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petryaev, 2020-02-17
@Gremlin92

Here it is described how to do it, but to tie it to OpenAL you will have to google a little https://audiocoding.ru/articles/2008-05-22-wav-fil...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question