Skip to content

Instantly share code, notes, and snippets.

@Xenakios
Last active November 7, 2025 19:35
Show Gist options
  • Select an option

  • Save Xenakios/e38cdec2af2ea654a34dbdcc9ebb2daf to your computer and use it in GitHub Desktop.

Select an option

Save Xenakios/e38cdec2af2ea654a34dbdcc9ebb2daf to your computer and use it in GitHub Desktop.
inline void test_choc_scandinavian()
{
choc::audio::WAVAudioFileFormat<true> wavformat;
std::vector<std::string> filenamestotest{
R"(C:\MusicAudio\sourcesamples\test_signals\tones\😮_count_🧨.wav)",
R"(C:\MusicAudio\sourcesamples\test_signals\tones\count.wav)",
R"(C:\MusicAudio\sourcesamples\test_signals\tones\ÄÖÅ_count_äöå.wav)"};
std::print("testing with std::string paths directly\n");
for (auto &path : filenamestotest)
{
auto reader = wavformat.createReader(path);
if (reader)
std::print("{} [OK]\n", path);
else
std::print("{} [FAILED]\n", path);
}
std::print("testing with custom created std::ifstream instances from paths\n");
for (auto &path : filenamestotest)
{
std::filesystem::path infilepath{std::filesystem::u8path(path)};
std::shared_ptr<std::istream> is{new std::ifstream(infilepath, std::ios::binary)};
auto reader = wavformat.createReader(is);
if (reader)
std::print("{} [OK]\n", path);
else
std::print("{} [FAILED]\n", path);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment