Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
853 stars 555 forks source link

[enh] Duration for PCM #540

Open leegohi04517 opened 3 years ago

leegohi04517 commented 3 years ago

Flutter Sound Version :


Severity


Platforms you faced the error

Both emulator and real device.


Logs

(This is very important. Most of the time we cannot do anything if we do not have information on your bug)

Getting media information for /Users/captain/Library/Developer/CoreSimulator/Devices/42B7FF65-4BC7-4854-B488-5BB15C679866/data/Containers/Data/Application/3876AEE1-1DA2-4904-9E94-4244E40D31C6/Library/Caches/b7917cc99fd14a1435695b10903cc665. ERROR: /Users/captain/Library/Developer/CoreSimulator/Devices/42B7FF65-4BC7-4854-B488-5BB15C679866/data/Containers/Data/Application/3876AEE1-1DA2-4904-9E94-4244E40D31C6/Library/Caches/b7917cc99fd14a1435695b10903cc665: Invalid data found when processing input /Users/captain/Library/Developer/CoreSimulator/Devices/42B7FF65-4BC7-4854-B488-5BB15C679866/data/Containers/Data/Application/3876AEE1-1DA2-4904-9E94-4244E40D31C6/Library/Caches/b7917cc99fd14a1435695b10903cc665: Invalid data found when processing input


Screenshots

(If applicable, add screenshots to help explain your problem).


Describe the bug A clear and concise description of what the bug is.

Thank you a lot. It's a cool sound plugin. After i used FlutterSoundRecorder to record a pcm16 codec sound , then FlutterSoundHelper failed to get that sound file duration ,with a error above.

Larpoux commented 3 years ago

Please look to this :

Note the following limitations in the current Flutter Sound version :

  • The stream is PCM-Integer Linear 16 with just one channel. Actually, Flutter Sound does not manipulate Raw PCM with floating point PCM data nor with more than one audio channel.
  • FlutterSoundHelper duration() does not work with Raw PCM file
  • startPlayer() does not return the record duration. withUI parameter in openAudioSession() is actually incompatible with Raw PCM files.

This will be certainly alleviated in future.

leegohi04517 commented 3 years ago

Please look to this :

Note the following limitations in the current Flutter Sound version :

  • The stream is PCM-Integer Linear 16 with just one channel. Actually, Flutter Sound does not manipulate Raw PCM with floating point PCM data nor with more than one audio channel.
  • FlutterSoundHelper duration() does not work with Raw PCM file
  • startPlayer() does not return the record duration. withUI parameter in openAudioSession() is actually incompatible with Raw PCM files.

This will be certainly alleviated in future.

Thanks a lot. Could you tell me how to prepare network sound? It costs many seconds to waiting for sound after calling startPlayer(remoteUrl) .

leegohi04517 commented 3 years ago

ok i will try startPlayer(fromDataBuffer)

Larpoux commented 3 years ago

Another Flutter Sound user had the same problem than you : the delay when starting a playback from a remote site was too long for him/her. This is another point that we will work on soon.

Yes, if you download your remote song, there will be no delay when startPlayerFromBuffer()

Larpoux commented 3 years ago

Registered in the Flutter Sound Project

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.