setAudioEncodingBitRate best quality audio mic?

180 views
Skip to first unread message

Yofree United

unread,
Nov 22, 2022, 10:23:07 AM11/22/22
to Tinode General
app\src\main\java\co\tinode\tindroid\MessagesFragment.java
mAudioRecorder.setAudioEncodingBitRate(128000);
mAudioRecorder.setAudioSamplingRate(44100);


Yofree United

unread,
Nov 22, 2022, 10:24:01 AM11/22/22
to Tinode General

for [android]
вторник, 22 ноября 2022 г. в 18:23:07 UTC+3, Yofree United:

Gene

unread,
Nov 22, 2022, 11:45:59 AM11/22/22
to Tinode General
I don't understand the question.

Yofree United

unread,
Nov 22, 2022, 11:47:05 PM11/22/22
to Tinode General
On the web client, the quality of the audio recording is high. On android client, too, make high-quality recording through a microphone.
For change lines 938,939
mAudioRecorder.setAudioEncodingBitRate(16);
mAudioRecorder.setAudioSamplingRate(16000);

..on

mAudioRecorder.setAudioEncodingBitRate(128000);
mAudioRecorder.setAudioSamplingRate(44100);

Why is the audio stored in the database? Why not in a file like other files.

Thanks!

Gene

unread,
Nov 23, 2022, 12:43:32 AM11/23/22
to Tinode General
On Tuesday, November 22, 2022 at 8:47:05 PM UTC-8 Yofree United wrote:
On the web client, the quality of the audio recording is high.

That's an oversight. I'll add explicit parameters to setup.
 
On android client, too, make high-quality recording through a microphone.
For change lines 938,939
mAudioRecorder.setAudioEncodingBitRate(16);

This is a typo. Fixed, thanks.
 
mAudioRecorder.setAudioSamplingRate(16000);

..on

mAudioRecorder.setAudioEncodingBitRate(128000);
mAudioRecorder.setAudioSamplingRate(44100);

The recording is for voice which is ~8KHz range. Why does it need to be music-quality? The parameters you proposed will create much larger files.  

Why is the audio stored in the database? Why not in a file like other files.

Small objects are stored in the database, large are stored in a dedicated storage. It's controlled by
 

Thanks!

Yofree United

unread,
Nov 23, 2022, 4:40:55 AM11/23/22
to Tinode General

Why is the audio stored in the database? Why not in a file like other files.

Small objects are stored in the database, large are stored in a dedicated storage. It's controlled by
 
Thank you.

Additionally, long audios are recorded but not played back. Not in tindroid, not in webapp. The file is created but does not play for longer than 6-8 seconds.

web client
Screenshot_14.png 

android client
 Screenshot_15.png



Gene

unread,
Nov 23, 2022, 4:50:31 PM11/23/22
to Tinode General
I can reproduce in Android but not in web.

Yofree United

unread,
Nov 24, 2022, 1:20:56 AM11/24/22
to Tinode General
I think this is a server cause in the chat. Tried changing the amount of memory max_message_size in tinode.conf. But it doesn't seem to affect the audio messages.
All actions are performed from one account. Recorded audio, both with android and web clients. Сan't listen to the audio message for more than ~8 seconds.

четверг, 24 ноября 2022 г. в 00:50:31 UTC+3, Gene:

Gene

unread,
Nov 24, 2022, 11:58:59 AM11/24/22
to Tinode General
It's a client issue on Android. I'm working on it.
I cannot reproduce in webapp.

Yofree United

unread,
Nov 27, 2022, 9:27:38 AM11/27/22
to Tinode General

I cannot reproduce in webapp.
More than one minute of audio is definitely not recorded.

Анимация3.gif

Gene

unread,
Nov 27, 2022, 3:02:09 PM11/27/22
to Tinode General
On Sunday, November 27, 2022 at 6:27:38 AM UTC-8 Yofree United wrote:

I cannot reproduce in webapp.
More than one minute of audio is definitely not recorded.

And I definitely cannot reproduce. Please file a bug report with steps to reproduce.
 

Анимация3.gif

Yofree United

unread,
Nov 28, 2022, 4:59:19 AM11/28/22
to Tinode General

Sorry for earlier.
And what kind of bug report to prepare?
Screenshots Chat Server Console, Web Developer?
воскресенье, 27 ноября 2022 г. в 23:02:09 UTC+3, Gene:

Gene

unread,
Nov 28, 2022, 11:33:23 AM11/28/22
to Tinode General
On Monday, November 28, 2022 at 1:59:19 AM UTC-8 Yofree United wrote:

Sorry for earlier.
And what kind of bug report to prepare?

Please answer all questions and attach logs. Thanks.

Gene

unread,
Dec 4, 2022, 12:16:24 PM12/4/22
to Tinode General
On Wednesday, November 23, 2022 at 1:40:55 AM UTC-8 Yofree United wrote:

Why is the audio stored in the database? Why not in a file like other files.

Small objects are stored in the database, large are stored in a dedicated storage. It's controlled by
 
Thank you.

Additionally, long audios are recorded but not played back. Not in tindroid

The issue with long audio records not working in Android is fixed in https://github.com/tinode/tindroid/tree/media and merged to devel.
There is an issue with seeking longs recorded in Chrome due to this bug:
I'll try to fix it in the webapp.

Yofree United

unread,
Dec 5, 2022, 2:57:07 AM12/5/22
to Tinode General
 
The issue with long audio records not working in Android is fixed in https://github.com/tinode/tindroid/tree/media and merged to devel.
Crash. When trying to play long audio.
 
There is an issue with seeking longs recorded in Chrome due to this bug:
I'll try to fix it in the webapp.
Firefox same way. 
 
Last version https://github.com/tinode/webapp/tree/next webapp. Empty page.


 

Gene

unread,
Dec 5, 2022, 11:47:26 AM12/5/22
to Tinode General
On Sunday, December 4, 2022 at 11:57:07 PM UTC-8 Yofree United wrote:
 
The issue with long audio records not working in Android is fixed in https://github.com/tinode/tindroid/tree/media and merged to devel.
Crash. When trying to play long audio.

As I said many times before, I need steps to reproduce. You can do it by filing a bug report.
 
 
There is an issue with seeking longs recorded in Chrome due to this bug:
I'll try to fix it in the webapp.
Firefox same way. 

It uses the same rendering engine as Chrome. The fix applies to both.
 
 
Last version https://github.com/tinode/webapp/tree/next webapp. Empty page.

I know. Next is not supposed to be stable or even usable.
 


 

Yofree United

unread,
Dec 12, 2022, 3:27:47 PM12/12/22
to Tinode General

Yofree United

unread,
Dec 17, 2022, 2:45:58 AM12/17/22
to Tinode General


понедельник, 5 декабря 2022 г. в 19:47:26 UTC+3, Gene:
On Sunday, December 4, 2022 at 11:57:07 PM UTC-8 Yofree United wrote:
 
The issue with long audio records not working in Android is fixed in https://github.com/tinode/tindroid/tree/media and merged to devel.
Crash. When trying to play long audio.

As I said many times before, I need steps to reproduce. You can do it by filing a bug report.
 

Found an crash [tindroid]
1 Record audio from webapp client for at least 1 min.
2 Record android client audio for at least 1 min.

On android(tindroid), start playing audio recording from the webapp by rewinding. And immediately launch the audio recorded on the android. It will crash (tindroid) immediately.

 

Gene

unread,
Dec 17, 2022, 12:22:05 PM12/17/22
to Tinode General

Yofree United

unread,
Dec 21, 2022, 2:22:02 AM12/21/22
to Tinode General
суббота, 17 декабря 2022 г. в 20:22:05 UTC+3, Gene:
No it is additionally 

logcat (android studio)
server console

Gene

unread,
Dec 21, 2022, 11:39:08 AM12/21/22
to Tinode General
I don't see  any crashes in the linked logcat.

Gene

unread,
Dec 21, 2022, 11:40:57 AM12/21/22
to Tinode General
When recording logcat, please limit it to Tindroid and set log level to verbose.

Gene

unread,
Dec 21, 2022, 12:56:34 PM12/21/22
to Tinode General
Anyway, I think I know what the problem is:

Yofree United

unread,
Dec 21, 2022, 5:20:20 PM12/21/22
to Tinode General

Anyway, I think I know what the problem is:
 Still closing

Gene

unread,
Dec 21, 2022, 5:27:39 PM12/21/22
to Tinode General
Please attach logcat directly to to the message here. 

Screenshot 2022-12-21 at 14.26.09.png

Yofree United

unread,
Dec 21, 2022, 5:29:52 PM12/21/22
to Tinode General
All that is...
Screenshot_39.png
четверг, 22 декабря 2022 г. в 01:27:39 UTC+3, Gene:

Gene

unread,
Dec 21, 2022, 5:35:47 PM12/21/22
to Tinode General
Become a group member and you will be able to add attachments. Or use some other file exchange service with less spam.

Gene

unread,
Dec 21, 2022, 5:38:01 PM12/21/22
to Tinode General
I still do not see any crashes in the log.

Yofree United

unread,
Dec 21, 2022, 5:39:47 PM12/21/22
to Tinode General
Thank you for the clarification

четверг, 22 декабря 2022 г. в 01:38:01 UTC+3, Gene:
logcat.txt

Yofree United

unread,
Dec 21, 2022, 5:45:45 PM12/21/22
to Tinode General
2022-12-22 01:42:14.355 The start of the hang

Screenshot_20221222_010845.png

2022-12-22 01:42:48.189 Clicked on Close app

четверг, 22 декабря 2022 г. в 01:38:01 UTC+3, Gene:
logcat.txt

Yofree United

unread,
Dec 21, 2022, 5:51:06 PM12/21/22
to Tinode General
last log I think this is it 2022-12-22 01:43:22.780  1188-1206  ActivityManager         pid-1188                             I  Killing 31334:co.tinode.tindroidx/u0a270 (adj 0): user request after error

Gene

unread,
Dec 21, 2022, 9:08:02 PM12/21/22
to Tinode General
I added try/catch around setDataSource. It should not crash now.

Yofree United

unread,
Dec 22, 2022, 12:21:25 AM12/22/22
to Tinode General

It did not help. Now you can't record long audio.
Screenshot_40.png

Even after adding video.
Video loading works but image loading stopped working.

четверг, 22 декабря 2022 г. в 05:08:02 UTC+3, Gene:

Gene

unread,
Dec 22, 2022, 12:38:44 AM12/22/22
to Tinode General
I cannot reproduce. Please show the logs.

Gene

unread,
Dec 22, 2022, 12:42:04 AM12/22/22
to Tinode General
On Wednesday, December 21, 2022 at 9:21:25 PM UTC-8 Yofree United wrote:

It did not help. Now you can't record long audio.

If it does not crash then it did help. I'm pretty sure it does not crash on that audio that it was crashing on before.

Gene

unread,
Dec 22, 2022, 12:44:37 AM12/22/22
to Tinode General
On Wednesday, December 21, 2022 at 9:21:25 PM UTC-8 Yofree United wrote:

It did not help. Now you can't record long audio.
Screenshot_40.png

Even after adding video.
Video loading works but image loading stopped working.

Are you reporting problems on next?

Yofree United

unread,
Dec 22, 2022, 1:11:49 AM12/22/22
to Tinode General
Yes next, sorry my inattention.

On devel remained unchanged. It hangs and then offers to close or wait.

четверг, 22 декабря 2022 г. в 08:44:37 UTC+3, Gene:

Yofree United

unread,
Dec 22, 2022, 1:32:28 AM12/22/22
to Tinode General

Yes next, sorry my inattention.

On devel remained unchanged. It hangs and then offers to close or wait.

The freeze comes only from long audios (<1min) and only recorded via webapp.
If  jumping between webapp and tindroid records while scrolling through the audio record.


Yofree United

unread,
Dec 22, 2022, 1:50:22 AM12/22/22
to Tinode General
Top 3 audios recorded from webapp and bottom 3 from tindroid.
When I start the webapp recording by scrolling, and then I start the recording with tindroid, it freezes.



The freeze comes only from long audios (<1min) and only recorded via webapp.
If  jumping between webapp and tindroid records while scrolling through the audio record.

 

Gene

unread,
Dec 24, 2022, 1:23:50 PM12/24/22
to Tinode General
Is this happening in emulator or a real device? Apparently there is a bug in the emulator which makes MediaPlayer hang on redirects.

Yofree United

unread,
Dec 25, 2022, 11:25:49 AM12/25/22
to Tinode General
Real device Cubot X30, Android 10

суббота, 24 декабря 2022 г. в 21:23:50 UTC+3, Gene:

Gene

unread,
Dec 25, 2022, 11:27:46 AM12/25/22
to Tinode General
Can you show the logs from device when that problem happens?

Yofree United

unread,
Dec 25, 2022, 1:59:04 PM12/25/22
to Tinode General

Can you show the logs from device when that problem happens?

 
bugreport-X30_EEA-QP1A.190711.020-2022-12-25-21-54-31.zip (5904 КБ)
bugreport-X30_EEA-QP1A.190711.020-2022-12-25-21-54-31.zip

Gene

unread,
Dec 25, 2022, 4:52:27 PM12/25/22
to Tinode General
It might be something specific to your phone.

Yofree United

unread,
Dec 27, 2022, 7:26:32 AM12/27/22
to Tinode General
I doubt that only with my model such a closure. I tried it on other models, as a result, the application hangs and closes.
I suspect that the hang may be due to connecting the database, searching for audio playback files.
Which fails to play with the transition between playing long audios and scrolling through them.
Next comes the closing of applications that cannot be played.

понедельник, 26 декабря 2022 г. в 00:52:27 UTC+3, Gene:
Reply all
Reply to author
Forward
0 new messages