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

iOS Audio File Processing Error with Large MP3 Files #132

Open
AnkitBathla11 opened this issue Nov 12, 2024 · 2 comments
Open

iOS Audio File Processing Error with Large MP3 Files #132

AnkitBathla11 opened this issue Nov 12, 2024 · 2 comments

Comments

@AnkitBathla11
Copy link

AnkitBathla11 commented Nov 12, 2024

iOS Audio File Processing Error with MP3 Files

Description

When processing audio files of larger size on iOS, the system encounters multiple errors during waveform extraction and player preparation. The audio file is being downloaded using RNFetchBlob.

Steps to Reproduce

  1. Download audio file using RNFetchBlob
  2. Attempt to process an audio file
  3. Test case example file: MP3 Sample

Current Implementation

Using RNFetchBlob to download the audio file:

private async downloadUrl(path: string): Promise<string> {
    try {
      const {dirs} = RNFetchBlob.fs

      const tempFilePath =
        Platform.OS === 'ios'
          ? `${dirs.DocumentDir}/waveform_${Date.now()}.mp3`
          : `${dirs.CacheDir}/waveform_${Date.now()}.mp3`

      const res = await RNFetchBlob.config({
        path: tempFilePath,
      }).fetch('GET', path)

      if (res.respInfo.status !== 200) {
        throw new Error('File download failed')
      }

      return tempFilePath
    } catch (error) {
      console.log('Error downloading file:', error)

      throw new Error('Failed to download the file')
    }
  }

Errors Encountered

Waveform Extraction Error

MP3AudioFile.cpp:1526   Problem scanning for packets
MP3AudioFile.cpp:1065   MPEGAudioFile::OpenFromDataSource failed
AudioFileObject.cpp:105    OpenFromDataSource failed
AudioFileObject.cpp:80     Open failed
 ExtAudioFile.cpp:211   about to throw 'dta?': open audio file
 AVAEInternal.h:109   [AVAudioFile.mm:135:AVAudioFileImpl: (ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)): error 1685348671

Player Preparation Error

MP3AudioFile.cpp:1526   Problem scanning for packets
MP3AudioFile.cpp:1065   MPEGAudioFile::OpenFromDataSource failed
AudioFileObject.cpp:105  OpenFromDataSource failed
AudioFileObject.cpp:80   Open failed

Environment

  • Platform: iOS
  • File Type: MP3
  • File Size: >1MB and larger
  • Library: RNFetchBlob for file download
  • Storage Location: DocumentDir (iOS)

Additional Information

  • Error occurs with files of larger size
  • Both waveform extraction and player preparation are affected
  • Files are being downloaded to the app's document directory on iOS
  • The issue is reproducible with the exact test file provided
@AnkitBathla11
Copy link
Author

@mukesh-simform could you please help here

@kuldip-simform
Copy link
Contributor

@AnkitBathla11 If you can provide a use repo with all the code to reproduce, that would be helpful. If you can share repo, that would be ideal.

We have tried to reproduce this issue with the media file you have provided, but we are not able to reproduce this issue.

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