react-native-track-player: cannot play in ios with base64 audio

Describe the Bug when i playing base64 audio with track player it works well on ios 15,16 etc.but it deosn’t work on ios 17 beta and ios 14. I am testing with both physical devices and simulators.May be this with something to do with base64 audio memory stream. But we need this kind of features to carete encrypted/decrypted audio player.

{“error”: {“code”: “ios_track_unplayable”, “message”: “The track could not be played”}, “state”: “error”} this is error message from track player.

StreamingPlaylist_VerifyLeadingMagicNumber: missing #EXTM3U (this is error message from xcode) Steps To Reproduce How can someone else reproduce this bug?

Code To Reproduce const App = () => { const track1 = { url: data:audio/wav;base64,${auidoBase64}, // Load media from the app bundle title: ‘Coelacanth I’, artist: ‘deadmau5’, // Load artwork from the app bundle duration: 166, };

const track2 = { url: require(‘./auido/file_example_WAV_2MG.wav’), // Load media from the app bundle title: ‘Coelacanth I’, artist: ‘deadmau5’, // Load artwork from the app bundle duration: 166, };

const setUpPlayer = async () => { await TrackPlayer.setupPlayer({ iosCategory:IOSCategory.PlayAndRecord,

});

}; useEffect(() => { setUpPlayer(); }, []);

const duration = useProgress().duration; const position = useProgress().position;

const addSong = async () => { await TrackPlayer.add({ …track1,

  contentType:'audio/wav',
  pitchAlgorithm:PitchAlgorithm.Linear
});
console.log("Successfully added song...")

};

const playSong = async () => { await TrackPlayer.play(); console.log(“Successfully Play song…”) };

const pauseSong = async () => { await TrackPlayer.pause(); console.log(“Successfully Pause song…”) };

const resetSong = async () => { await TrackPlayer.reset(); console.log(“Successfully Reset song…”) };

console.log(“Progress==>”,useProgress()) console.log(“State===>”,usePlaybackState()) return ( <View style={{flex: 1, justifyContent: ‘center’, alignItems: ‘center’}}> <View style={{ flexDirection: ‘row’, width: 100, justifyContent: ‘space-between’, marginBottom: 30, }}> <Text>{duration}</Text> <Text>{position}</Text> </View> <Pressable style={{marginBottom: 10}} onPress={playSong}> <Text>Play</Text> </Pressable> <Pressable style={{marginBottom: 10}} onPress={pauseSong}> <Text>Pause</Text> </Pressable>

  <Pressable onPress={addSong}>
    <Text>Add</Text>
  </Pressable>

  <Pressable onPress={resetSong}>
  <Text>Reset</Text>
</Pressable>
</View>

); };

export default App;

Replicable on Example App? Can you replicate this bug in the React Native Track Player Example App?

Environment Info: System: OS: macOS 13.4 CPU: (8) x64 Apple M1 Memory: 26.90 MB / 8.00 GB Shell: version: “5.9” path: /bin/zsh Binaries: Node: version: 16.14.0 path: /usr/local/bin/node Yarn: version: 1.22.19 path: /usr/local/bin/yarn npm: version: 9.6.7 path: /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.11.3 path: /usr/local/bin/pod SDKs: iOS SDK: Not Found Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: version: /undefined path: /usr/bin/xcodebuild Languages: Java: version: 11.0.15 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: “@react-native-community/cli”: Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.3 wanted: 0.72.3 react-native-macos: Not Found npmGlobalPackages: “react-native”: Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false “react-native-track-player”: "^3.2.0 both device and simualtors macos version 13.5

How I can Help What can you do to help resolve this? Have you investigated the underlying JS or Swift/Android code causing this bug?

Can you create a Pull Request with a fix?

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 15 (5 by maintainers)

Most upvoted comments

@dcvz same issue. Please help me 😭

No fixes for this yet!