audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

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

Open Sundin opened this issue 2 years ago • 4 comments

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.

Sundin avatar Jul 31 '21 16:07 Sundin

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.

IlyaSemenov avatar Dec 04 '21 09:12 IlyaSemenov

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.

filiph avatar Dec 21 '21 17:12 filiph

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

arnirichard avatar Sep 14 '22 13:09 arnirichard

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

Gustl22 avatar Sep 21 '22 13:09 Gustl22

Seems also related to #748 #803

Gustl22 avatar Sep 27 '22 15:09 Gustl22