bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2k stars 845 forks source link

Non-ASCII characters in sound file names doesn't work on iOS #972

Closed Sundin closed 1 year ago

Sundin commented 3 years ago

Hi and thanks for an awesome library! I use it a lot.

After upgrading from v0.17.4 to v0.19.0, sound files with spaces in their names doesn't see to work on iOS anymore. Still works fine on Android though.

Full Description The audio file never seems to start playing on iOS... At least I can't hear it. Worked fine before upgrading to v0.19.0. The player still reports PlayerState.PLAYING though.

After replacing spaces with underscores, everything works fine again.

Code to Reproduce

AudioCache cache = new AudioCache(prefix: 'assets/sounds/');
AudioPlayer player = await cache.play("My Sound.mp3");

Log Errors No error message is logged.

Platforms The bug arises on iOS 14.6. Still works on Android 6.0.1.

IlyaSemenov commented 2 years ago

It's not only about spaces. For instance, I had a file named assets/audio/ВИЧ_и_искусство.mp3 which never played until I renamed it to be ASCII only.

filiph commented 2 years ago

Just confirming that the workaround is to replace spaces with something else (and non-ASCII characters with ASCII ones).

This problem is especially nasty since it doesn't produce any error at all, so I'm glad this issue exists.

arnirichard commented 2 years ago

I can't play sound files in Thai on web (Windows Chrome), Android works well

await player.play(AssetSource('assets/sounds/ผม.wav'))

Error: NotSupportedError: The element has no supported sources. C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 299:10 createErrorWithStack C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 341:28 _throw C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/core/errors.dart 116:5 throwWithStackTrace C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1378:11 callback C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15

I have tried all (3) Flutter audio players and I have problems with all of them

Gustl22 commented 2 years ago

We are lacking of mac, so we are dependent on the community to provide a Merge request. Thx.

Gustl22 commented 2 years ago

Seems also related to #748 #803