Skip to content

How to load music from document directory #36

@islom9797

Description

@islom9797

Thank you for so amazing package
How to load from document directory.At the moment work just load mp3 files from asset folder but I want to load music from document directory(data/user/0/com.example.moms_life_ekg/app_flutter/record/test_1687338283864.mp3 like this) but
AudioCache.load and AudioCache.loadAsFile does not work and giving error like this
RROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unable to load asset: "assets//data/user/0/com.example.moms_life_ekg/app_flutter/record/test_1687337809743.mp3".
E/flutter (29741): The asset does not exist or has empty data.
E/flutter (29741): #0 PlatformAssetBundle.load. (package:flutter/src/services/asset_bundle.dart:254:9)
E/flutter (29741):
E/flutter (29741): #1 AudioCache.fetchToMemory (package:audioplayers/src/audio_cache.dart:89:22)
E/flutter (29741):
E/flutter (29741): #2 AudioCache.load (package:audioplayers/src/audio_cache.dart:115:31)
E/flutter (29741):
E/flutter (29741):
Please can you explain how to load and play music from document directory thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions