the sound effects on the foreground and background of the iPad M1 are different
Which API doesn't behave as documented, and how does it misbehave? I found that the sound effects on the foreground and background of the iPad m1 are different, as if it has changed the effect sound
Minimal reproduction project Provide a link here using one of two options: 1.clone https://github.com/zhushenwudi/LoveLiveMusicPlayerMobile 2.find lib/global/global_player.dart
To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior: 1.play a music on the front 2.listen 3.change to back 4.listen 5.find sound effect are different
Error messages
no error message
Expected behavior A clear and concise description of what you expected to happen. I found that the sound effects on the front and back of the iPad m1 are different, as if it has changed the effect sound, This is not a problem with my speaker. I don’t have this problem on other music players.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS + 12.6
- Browser edge
Smartphone (please complete the following information):
- Device: iPad M1 11 inch
- OS: IOS 15.6.1
Flutter SDK version
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.6 21G115 darwin-arm, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
[✓] Chrome - develop for the web
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.1)
[✓] VS Code (version 1.71.1)
[✓] Connected device (2 available)
! Error: iPhone is not connected. Xcode will continue when iPhone is connected and unlocked. (code -13)
[✓] HTTP Host Availability
Additional context Add any other context about the problem here. nothing
Minimal reproduction project Provide a link here using one of two options: 1.clone https://github.com/zhushenwudi/LoveLiveMusicPlayerMobile 2.find lib/global/global_player.dart
Thank you for reporting, although your linked project is hardly minimal. I went to investigate various things in the code but didn't know where to start. (Although don't bother explaining the code, instead just make a minimal reproduction project.)
Minimal reproduction project Provide a link here using one of two options: 1.clone https://github.com/zhushenwudi/LoveLiveMusicPlayerMobile 2.find lib/global/global_player.dart
Thank you for reporting, although your linked project is hardly minimal. I went to investigate various things in the code but didn't know where to start. (Although don't bother explaining the code, instead just make a minimal reproduction project.)
I think I know why. For iPad with 4 speakers, IOS will control the sound level of each speaker according to the screen direction,I don't know how to keep the function of the gyroscope and prevent this feature of the system, so as to keep the sound of the four speakers unchanged
demo: https://github.com/zhushenwudi/just_audio_demo
So when you say "background", you don't actually mean the app is running in the background, you mean you are just turning the iPad over.
You can configure your app so that, for example, the app does not rotate when the device rotates. Maybe it's something like that? This plugin isn't itself responsible for those APIs, and it might not be an API but rather some configuration that you can set in Info.plist. If you do find an iOS API responsible for it, you should be able to implement that API if you can write Objective C or Swift code and link that into your app via method channels.
No, my formal program is to fix the screen direction to vertical. When the real direction of my device is horizontal, opening the app will change the direction, so that the sound will change. This is what I mistakenly thought was caused by the foreground and background switching. However, I tested other music players, which will not change the sound. So I came to ask how to modify it here, or what changes can be made in this library, such as adding schemes such as parameter transfer
just_audio uses this Apple API:
https://developer.apple.com/documentation/avfoundation/avqueueplayer?language=objc
If there is any further API in AVQueuePlayer that you need, I can add it to just_audio. However, there is also a good chance that this API is not the API that lets you control that type of thing. There are other audio-related API such as AVAudioSession (exposed by the audio_session plugin), for example.
I carefully analyzed the music player commonly used in China. After adjusting the volume, I found that he used algorithm to regulate sound effects to cheat ears and achieve the almost unchanged auditory experience (in fact, there are still a little changes).But this will definitely affect the original taste of the song.The rotating screen changed the sound field of the speaker. I checked the information of many years ago and found that this is Apple's software patent.So be it.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.