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

Sound quality #95

Closed
shanzhenghan opened this issue Jun 7, 2019 · 16 comments · Fixed by #167
Closed

Sound quality #95

shanzhenghan opened this issue Jun 7, 2019 · 16 comments · Fixed by #167

Comments

@shanzhenghan
Copy link

The recorded sound sounds echoed and distorted. In a large cave, for example, the volume is very small.

@kbanta11
Copy link

I'm having the same issue on android

@MsXam
Copy link

MsXam commented Jun 18, 2019

I have been using this package since early 1.x and the problem even occurred then. The problem is on Android only which makes this plugin unusable.

Here is another reference of the issue :-

#79

There has been no activity on this bug for a very long time so it would appear the package is no longer maintained which is a pity.

Does anyone know of a similar working plugin ?

@SethThoburn
Copy link

There's a fix mentioned for the garbled quality in that issue #79:
startRecorder(uri, androidEncoder: AndroidEncoder.AMR_WB);

@MsXam
Copy link

MsXam commented Jun 22, 2019

Unfortunately the fix mentioned in that issue doesnt resolve the poor sound quality (garbage sound and very low sound volume) - have tested on Samsung S8+ & S10+ live devices. Even 1.42 exhibits the same problem so the issue is far from fixed. I have created a Xamarin plugin for iOS & Android and I get perfect sound without any distortion. I may consider moving to dart and creating a universal sound plugin that has all of the functionality of this plugin less the many issues reported.

@MsXam
Copy link

MsXam commented Jun 22, 2019

P.s

re : #95 (comment)

The fix doesnt allow sound files to be shared between iOS/Android - recording in anything other then ...aac.. on Android will not play on iOS

@hyochan
Copy link
Collaborator

hyochan commented Jun 22, 2019

@MsXam Hi. If you were the maintainer of the Xamarin plugin, hope you can guide me here to maintain the library. I've been having hard time maintaining serveral other libraries today (and even suffering from insomnia 😞). I was so busy these days on my main job.

I hope you to be a great contributor and work with me rather than making your own! I can even give you and authority to the plugin.

@matheusperez
Copy link

There's a fix mentioned for the garbled quality in that issue #79:
startRecorder(uri, androidEncoder: AndroidEncoder.AMR_WB);

I tested it now, with this recommended and worked correctly

@MsXam
Copy link

MsXam commented Jun 28, 2019

@Matheus-Perez #95 (comment)

As mentioned - previously , In Android, current version 1.42, sound is not optimal and very faint as reported by several other users. As you know, writing great plugins means that they support 100% both platforms - I'm therefore unsure what your testing entails when you write

"I tested it now, with this recommended and worked correctly"

Since Adaptive multi rate wide band encoding is not supported in iOS in which case recording on one device (say Android) and then being able to listen to that recording on another device (say iOS) with a recording format of AMR_WB will obviously not work with this plugin - I hope you can see this.

Like Hyo Chan Jang , I'm super busy moving a very large Enterprise Xamarin app over to Flutter but also trying to find time to migrate my Xamarin Sound plugin over to Dart/Flutter where recording & playback work seamlessly in (iOS, Android, Mac, W10 etc).

FYI - The valid formats in iOS are defined here

codecs

and Audio file formats

This plugin (Flutter sound) therefore needs to allow seamless & perfect interchangeable recording and playback between its supported platforms (iOS & Android) and in its 1.42 form, it doesnt achieve that.

@phuchuynhStrong
Copy link

phuchuynhStrong commented Jul 3, 2019

After a lot of trials, I found something might help to improve sound quality on Android. The sound is better and can be play on iOS device. The fix I'm using startRecorder(uri, androidEncoder: AndroidEncoder.AAC, bitRate: 128000, sampleRate: 96000,). Increasing bitRate and sampleRate will produce larger files. It's depend on your requirement

@SethThoburn
Copy link

On a similar note, I've been getting very good quality with the AndroidEncoder.AAC, a bitrate of 256000, and a sample rate of 44100

@ghost
Copy link

ghost commented Aug 5, 2019

@MsXam Any chance you've made progress on the rewrite of the Xamarin Sound plugin?

@MsXam
Copy link

MsXam commented Aug 11, 2019

@SethThoburn bitRate of 256k and SampleRate of 44k is not conducive for writing cloud based enterprise apps where extremely small files are necessary to keep storage costs low as well as the time it takes to stream a file with these settings (even with compression enabled). A typical 6:21 sec AAC recording in Android with SampleRate 44k and bitRate 256k will produce a file of size 75k. This is 3 times the file size if we have SR of 16k and bitRate of 32k. Additionally - we have found ZERO improvement in sound quality when we adopt these settings (in Android).

@shanzhenghan with your settings , still we find sound quality very poor on Android and file size as per what you have written , i.e expect higher file size with these settings

@darren-f5s We were in the middle of a few very large important sprints so could not factor in as much time as we would have liked, however - we now have some slack so expect to work on this again now.

@hamadmarri
Copy link

Why not using ffmpeg plugin to convert audio formats after recording?

@ssbaval
Copy link

ssbaval commented Oct 23, 2019

This is really bad and cant believe how long this bug has been .... The sound quality is really poor in android - garbled. None of the recommendations work here - They increase the size of the AAC file by a factor of 10 which makes streaming to a cloud impossible and too costly and the sound quality still is not improved. ffmpeg is not feasible as it bloats an IPA or APK file considerably.

@hyochan
Copy link
Collaborator

hyochan commented Dec 7, 2019

Coming from #79. I hope you to see my reply

hyochan added a commit that referenced this issue Dec 8, 2019
+ Set android default encoding option to `AAC`.
+ Fix android default poor sound.
  - Resolve [#155](#155)
  - Resolve [#95](#95)
  - Resolve [#75](#79 Set android default encoding option to `AAC`.
+ Fix android default poor sound.
  - Resolve [#155](#155)
  - Resolve [#95](#95)
  - Resolve [#75](#79)
hyochan added a commit that referenced this issue Dec 8, 2019
Make ios & android audio format compatible by default

+ Set android default encoding option to `AAC`.
+ Fix android default poor sound.
  - Resolve [#155](#155)
  - Resolve [#95](#95)
  - Resolve [#75](#79 Set android default encoding option to `AAC`.
+ Fix android default poor sound.
  - Resolve [#155](#155)
  - Resolve [#95](#95)
  - Resolve [#75](#79)

* Fix default file extension to aac

* Revert default sample rate and num channel
@hyochan
Copy link
Collaborator

hyochan commented Dec 8, 2019

Please check out 1.6.0

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

Successfully merging a pull request may close this issue.

9 participants