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

Error caused by Soundfile fetching order. #19

Open
FayCarsons opened this issue Aug 29, 2024 · 1 comment
Open

Error caused by Soundfile fetching order. #19

FayCarsons opened this issue Aug 29, 2024 · 1 comment

Comments

@FayCarsons
Copy link

Fetching soundfiles with a declare soundfiles directive, in an environment where fetches to / can return invalid data, throws an exception.

For example, this fails on the Cables.gl platform:

declare soundfiles "https://foo.com/bar";

file = soundfile("baz.wav", 2);

While this succeeds:

file = soundfile("https://foo.com/bar/baz.wav", 2);

In the case of Cables, what appears to be happening is that Cables responds to fetch(/baz.wav) with HTML as opposed to a 404. This causes FaustWASM to throw a "cannot decode audio data" exception. Changing the order the URLs are tried in, starting with the URL defined in the declare soundfiles directive as root, should solve this.

I would be happy to take this on but I may need some help determining which general part of the Soundfile or SoundfileReader class I would need to fix.

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

2 participants