ukasz123 / soundpool Goto Github PK
View Code? Open in Web Editor NEWSoundpool plugin for Flutter
Soundpool plugin for Flutter
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':soundpool' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51
Hi.
I realized, that there is a TODO in your code, where this should be handled.
I did a modification, and I am curious about your opinion.
So, in SwiftSoundPoolPlugin.swift, I did this:
case "initSoundpool":
let wrapper = SoundpoolWrapper()
let index = wrappers.count
//my code, instead of your TODO >>
let attributes = call.arguments as! NSDictionary
let streamTypeIndex = attributes["streamType"] as! Int
if streamTypeIndex == 1 {
do {
try AVAudioSession.sharedInstance ().setCategory (AVAudioSession.Category.playback)
do {
try AVAudioSession.sharedInstance ().setActive (true)
} catch _ as NSError {
}
} catch _ as NSError {
}
}
//my code, instead of your TODO <<
wrappers.append(wrapper)
result(index)
This solves the problem perfectly. So, what do you think?
Br, Daneed
/Users/timwhiting/flutter/.pub-cache/hosted/pub.dartlang.org/soundpool_macos-0.2.6/macos/Classes/SwiftSoundpoolPlugin.swift:27:33: error: cannot find 'wrapperById' in scope
guard let wrapper = wrapperById(id: index) else {
^~~~~~~~~~~
/Users/timwhiting/flutter/.pub-cache/hosted/pub.dartlang.org/soundpool_macos-0.2.6/macos/Classes/SwiftSoundpoolPlugin.swift:41:33: error: cannot find 'wrapperById' in scope
guard let wrapper = wrapperById(id: index) else {
Seems to be missing a function to get the wrapper by id.
Hello there!
As the title says, there is any near plan to support Flutter 2.0?
Thank you!
I am using the version 1.1.3 (latest). In my iPhone I have a music playing in background. Every time when I use your lib to play an asset mp3 file (1 sec beep). The sound is played well indeed but the music is stopped.
Could you check it?
Build failed with the following exception:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'soundpool' is using version 1.1.51.
Thanks.
After upgrading from version 0.6.1 to 1.0.1, running on iOS generates a "Error running pod install".
Here's part of the stack:
-> Fetching podspec for
soundpool_webfrom
.symlinks/plugins/soundpool_web/ios[!] No podspec found for
soundpool_webin
.symlinks/plugins/soundpool_web/ios/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/external_sources/path_source.rb:14:in
block in fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/external_sources/path_source.rb:11:in
fetch'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:901:in fetch_external_source' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:880:in
block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:879:in each' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:879:in
block in fetch_external_sources'
`
Any plans on getting rid of this annoying message?
'Soundpool' is deprecated and shouldn't be used. Use fromOptions
instead.
Try replacing the use of the deprecated member with the replacement.
This is the line that is causing the message:
static final Soundpool _soundpool = Soundpool();
Hi, I'm creating app and added mini-game to play music. User has 3x3 squares and when click one sound sample starts to play. I want to sounds overlap (first sound plays user clicks second square and they play together or user spam one sound and it overlapes). My approach for this is:
onPressed: () async { Soundpool pool = Soundpool(); await pool.loadAndPlay(sound1); },
for every button.
sound1 is sound1 = await rootBundle.load('assets/sounds/1.mp3')
but after maybe 30 plays of some sound it won't play anymore. After that I don't receive any logs. I think my solution is wrong can you help me? Możemy pisać po polsku bo mój angielski jest trochę łamany, z góry dzięki za pomoc bo to bardzo ważne dla mnie :)
Hello!
Please tell me how to play the sound not through the speakerphone (through the phone speaker)
Regards, Konstantin
Very thanks you made this project, it is help a lot.
but i got a issue, i can play local audio file on iOS, but id is not work on android . this is my code:
// file: /data/data/me.ajax.test/app_flutter/audios/sound.mp3 Soundpool pool = Soundpool(streamType: StreamType.music); return pool.loadAndPlayUri(Uri.file(file).toString());
Hello,
Plugin work good with debugging but i can't build release.
Here my error :
Failed to apply plugin [id 'com.android.library']
Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in D:\flutter.pub-cache\hosted\pub.dartlang.org\soundpool_macos-0.2.4\android\gradle\wrapper\gradle-wrapper.properties to gradle
-5.4.1-all.zip
I can't edit D:\flutter.pub-cache\hosted\pub.dartlang.org\soundpool_macos-0.2.4\android\gradle\wrapper\gradle-wrapper.properties file because to build in production, I use appcenter platform which reinstall all plugin for each build.
Can't find this class anywhere. Is this for an upcoming release?
Hello.
Is it possible to add a method/setting/parameter to set volume for playing sounds?
for example,
Future<int> play(int soundId, {int repeat = 0, double rate = 1.0, double volume = 1.0}) async {
// ...
}
Thanks.
When playing a long sound (e.g. background music), and a second sound is played (like a notification), the first sound is stopped abruptly.
This issue is only present on Android. Works fine on iOS.
I'm using version 1.1.2.
I'm having to use soundpool 0.5.4 because newer versions of soundpool have a dependency on plugin_platform_interface 1.0.0. Many of my other plugins are using plugin_platform_interface ^2.0.0 now. Any chance soundpool can be updated to ^2.0.0 ? All ~50 of my project plugins are latest versions, except soundpool.
Hi, thanks for a nice and simple package!
I've found an issue on iOS where sound gets cut off at the end sometimes. It's not on every file but it is consistent for the files where it does happen. I've found that the issue disappears when I comment out the following line:
The issue appears even when rate is set to 1.0. It might be related to floating point rounding somewhere in CoreAudio.
Could an enableRate flag be used for soundpool as well perhaps? So that apps not needing rate control can avoid enableRate being set on the iOS side?
Hello,
I've been using the package in my Android app with no issues, but we are now developing the iOS version and adapting the Flutter code to work in both OS.
The issue I found is that the app literally crashes and just shows the next message whenever we play audio: Lost connection to device
I tried recreating the issue in a new Flutter project and it happens too whenever I play audio from an url using pool.loadAndPlayUri(uri);
where uri is a valid string and plays properly in Android.
I opened the issue just to communicate the problem and ask if there is some special permission needed in iOS to play the audio from url using this package. We are using a physical iPhone 6 and the software version is 12.4.5. Happens also when running the iOS simulator with an iPhone 11.
Thanks in advance!
I'm trying to use soundpool 1.1.1 on my phone but I occasionally test on macos due to easiness, however, if soundpool 1.1.1 is included in pubspec.yaml, macos build doesn't build. Tried flutter clean, doesn't help. Log:
gintas-mac:carwash gintas$ flutter build macos
Running pod install... 7.6s
2020-07-07 12:00:03.228 xcodebuild[46579:6897195] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18> == Underlying device preparation errors ==
2020-07-07 12:00:03.228 xcodebuild[46579:6897195] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fa978634780:'com.apple.platform.iphoneos':<DVTFilePath:0x7fa978634700:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18>";
}
--
2020-07-07 12:00:03.228 xcodebuild[46579:6897195] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18> == END: Underlying device preparation errors ==
2020-07-07 12:00:05.942 xcodebuild[46579:6897195] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18> == Underlying device preparation errors ==
2020-07-07 12:00:05.942 xcodebuild[46579:6897195] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fa978634780:'com.apple.platform.iphoneos':<DVTFilePath:0x7fa978634700:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18>";
}
--
2020-07-07 12:00:05.942 xcodebuild[46579:6897195] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fa97f85c1c0), iPhone, iPhone, 13.4.1 (17E262), 4738658ef9595c7f1422f153d1398374552d4b18> == END: Underlying device preparation errors ==
** BUILD FAILED **
The following build commands failed:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
CompileSwift normal x86_64 /Users/gintas/flutter/.pub-cache/hosted/pub.dartlang.org/soundpool_macos-0.2.3/macos/Classes/SwiftSoundpoolPlugin.swift
(2 failures)
Building macOS application...
Build process failed
If I open xcode, manage schemes, then select soundpool_macos, then try to build, I see this error:
gintas-mac:carwash gintas$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0-2.0.pre, on Mac OS X 10.15.5 19F101, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[!] VS Code (version 1.43.2)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (4 available)
! Doctor found issues in 1 category.
gintas-mac:carwash gintas$
Hello, I am trying to use your component to play a short sound whenever a user enters an incorrect item number.
I have this simple utility class:
class SoundUtil {
static Future playErrorSound() async {
var pool = Soundpool(streamType: StreamType.notification);
int soundId = await rootBundle.load("assets/scan_fail.mp3").then((ByteData soundData) {
return pool.load(soundData);
});
int streamId = await pool.play(soundId);
}
}
Everything works fine for the first 10-12 plays, then it stops playing any sound. Below is the output from the console window.
Please advise. Thanks.
W/AudioTrack( 8291): AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 22050 Hz, output 48000 Hz
I/OMXClient( 8291): MuxOMX ctor
<repeated 10 times, once for each play>
W/AudioTrack( 8291): AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 22050 Hz, output 48000 Hz
I/OMXClient( 8291): MuxOMX ctor
I/art ( 8291): Do partial code cache collection, code=28KB, data=30KB
I/art ( 8291): After code cache collection, code=25KB, data=28KB
I/art ( 8291): Increasing code cache capacity to 128KB
W/AudioTrack( 8291): AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 22050 Hz, output 48000 Hz
E/AudioTrack( 8291): AudioFlinger could not create track, status: -12
E/SoundPool( 8291): Error creating AudioTrack
Hello,
When I try to play a sound on my android phone, the sound is considered not as a media but as a ring. If my phone is in silenced mode it doesn't produce any sound.
Any idea how to solve it?
thanks.
Hello,
I'm getting the following messages in my debug console when using soundpool on my Android only system.
Plugin project :soundpool_web not found. Please update settings.gradle.
Plugin project :soundpool_macos not found. Please update settings.gradle.
It doesn't seem to cause any issues, I'm just wondering if this is something on my end that I need to update?
Thank you,
Michael
On iOS, calling the play method stops any music playing in the background.
To reproduce, open the Music app on iOS (or any other music app) and start playing music. Then open the flutter app and play any sound using the Soundpool play method, the Music app will be interrupted and will stop any playing music.
Crashes with no error if .OGG files are used on iOS. Android works fine.
App returns to iPhone home screen.
I saw this package support android/ios/macos, and it seems lack of support for Linux/Windows desktop platform. Is there any plans or schedules for support them?
int m1 = new DateTime.now().millisecondsSinceEpoch;
await soundPool.play(soundId);
int m2 = new DateTime.now().millisecondsSinceEpoch;
print('[' + _tickCounter.toString() + '] ' + (m2 - m1).toString());
Once in a while I have a huge delay while playing a sound (see 111 ms). This messes up my metronome timing. Any way I can help / improve / fix that?
Thank you!
Trying to build my project on ios, I get the error 'fatal error: 'soundpool/soundpool-Swift.h' file not found'.
I'm using latest soundpool release: 0.5.1.
Any help?
Does not play sound on Android! PLEASE HELP
Hey, I've got this working beautifully on iOS Simulator, but as soon as I try to run it on a physical device there is no audio. I don't see any reference to plist key entries or any other setup. Am I missing something?
In the real Android sound pool we have 1 very important parameter i.e float rate to modify the pitch of the sound...
See this, it is the last argument:
play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)...
Does this flutter package have anything like that?
How may I handle such modification with your package... like we could in basic Android with Java?
Hi, we're using soundpool in our app and everything seemed to be working fine in testing, including on iOS devices. However, now it's published and we're getting some crash reports from apple. The app hasn't been extensively marketed yet fortunately, so these are just from testers, and it seems like it's something to do with the device being allowed to sleep with the app open and crashing. I'm not sure that that's the cause in all of the cases, just what one tester reported. No problems on Android, only iOS.
i try to build my ios project but it fails
the exception is:
Undefined symbols for architecture i386:
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in SwiftSoundpoolPlugin.o
"OBJC_CLASS$_FlutterStandardTypedData", referenced from:
objc-class-ref in SwiftSoundpoolPlugin.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Need to be able to unload some sounds that would no longer being needed and didn't want to empty the pool and re-add sound files. Since Android's SoundPool API has unload(int soundId)
it would be good if soundpool had it as well.
If this goes against the design decision of soundpool, please let me know so I can find another solution.
Do you plan to support macOS desktops?
Mabybe add a documentation note on platform support?
Hi there,
I'm looking for a convenience method that stops all currently playing sounds. Thank you for your time.
Hi,
https://github.com/calcitem/Sanmill/runs/2699121824?check_suite_focus=true build pass.
One day later, I use almost same source code rebuild again, however, build failed.
https://github.com/calcitem/Sanmill/runs/2703446669?check_suite_focus=true
I don't know why.
Can 6c05ac0 slove this issue?
Thanks!
Build error log:
[ ] [ +16 ms] /opt/hostedtoolcache/flutter/2.2.1-stable/x64/bin/cache/dart-sdk/bin/dart --disable-dart-dev /opt/hostedtoolcache/flutter/2.2.1-stable/x64/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root /opt/hostedtoolcache/flutter/2.2.1-stable/x64/bin/cache/artifacts/engine/common/flutter_patched_sdk_product/ --target=flutter --no-print-incremental-dependencies -Ddart.vm.profile=false -Ddart.vm.product=true --aot --tfa --packages /home/runner/work/Sanmill/Sanmill/src/ui/flutter_app/.dart_tool/package_config.json --output-dill /home/runner/work/Sanmill/Sanmill/src/ui/flutter_app/.dart_tool/flutter_build/bcee474ba3777f5405a824293a9c54dc/app.dill --depfile /home/runner/work/Sanmill/Sanmill/src/ui/flutter_app/.dart_tool/flutter_build/bcee474ba3777f5405a824293a9c54dc/kernel_snapshot.d package:sanmill/main.dart
[+6489 ms] [+7387 ms] /opt/hostedtoolcache/flutter/2.2.1-stable/x64/.pub-cache/hosted/pub.dartlang.org/soundpool-2.0.0-nullsafety.0/lib/soundpool.dart:288:48: Error: Too few positional arguments: 3 required, 2 given.
[ +7 ms] [ +1 ms] final int id = await _platformInstance.init(_streamType.index, _maxStreams);
[ ] [ ] ^
[+10183 ms] [+10142 ms] Persisting file store
[ ] [ +2 ms] Done persisting file store
[ ] [ +18 ms] "flutter assemble" took 18,008ms.
[ ] [ +2 ms] ensureAnalyticsSent: 0ms
[ ] [ +1 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ ] exiting with code 1
[ ] > Task :app:compileFlutterBuildRelease FAILED
[ ] [ +2 ms] Target kernel_snapshot failed: Exception
[ ] #0 KernelSnapshot.build (package:flutter_tools/src/build_system/targets/common.dart:291:7)
[ ] <asynchronous suspension>
[ ] #1 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:828:9)
[ ] <asynchronous suspension>
[ ] #2 Future.wait.<anonymous closure> (dart:async/future.dart)
[ ] <asynchronous suspension>
[ ] #3 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:766:32)
[ ] <asynchronous suspension>
[ ] #4 Future.wait.<anonymous closure> (dart:async/future.dart)
[ ] <asynchronous suspension>
[ ] #5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:766:32)
[ ] <asynchronous suspension>
[ ] #6 Future.wait.<anonymous closure> (dart:async/future.dart)
[ ] <asynchronous suspension>
[ ] #7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:766:32)
[ ] <asynchronous suspension>
[ ] #8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:595:16)
[ ] <asynchronous suspension>
[ ] #9 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:318:32)
[ ] <asynchronous suspension>
[ ] #10 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
[ ] <asynchronous suspension>
[ ] #11 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #12 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
[ ] <asynchronous suspension>
[ ] #13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
[ ] <asynchronous suspension>
[ ] #14 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #15 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
[ ] <asynchronous suspension>
[ ] #16 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[ ] <asynchronous suspension>
[ ] #17 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #18 main (package:flutter_tools/executable.dart:91:3)
[ ] <asynchronous suspension>
[ ] [ +4 ms]
[ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[ ] #1 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:335:7)
[ ] <asynchronous suspension>
[ ] #2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
[ ] <asynchronous suspension>
[ ] #3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
[ ] <asynchronous suspension>
[ ] #5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
[ ] <asynchronous suspension>
[ ] #6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
[ ] <asynchronous suspension>
[ ] #8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[ ] <asynchronous suspension>
[ ] #9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #10 main (package:flutter_tools/executable.dart:91:3)
[ ] <asynchronous suspension>
[ +89 ms] FAILURE: Build failed with an exception.
[ ] * Where:
[ ] Script '/opt/hostedtoolcache/flutter/2.2.1-stable/x64/packages/flutter_tools/gradle/flutter.gradle' line: 1035
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileFlutterBuildRelease'.
[ ] > Process 'command '/opt/hostedtoolcache/flutter/2.2.1-stable/x64/bin/flutter'' finished with non-zero exit value 1
[ +1 ms] * Try:
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] * Get more help at https://help.gradle.org
[ ] See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
[ ] BUILD FAILED in 2m 15s
I try to modify code to use new node:
calcitem/Sanmill@22cdeda
And build again, buit failed:
https://github.com/calcitem/Sanmill/runs/2703505085?check_suite_focus=true
[ ] FINE: Resolving dependencies finished (1.579s).
[ ] ERR : Error on line 17, column 11: Invalid description in the "soundpool" pubspec on the "soundpool_web" dependency: "../soundpool_web" is a relative path, but this isn't a local pubspec.
[ ] | ╷
[ ] | 17 │ path: ../soundpool_web
[ ] | │ ^^^^^^^^^^^^^^^^
[ ] | ╵
So how to modify pubspec.yaml to use unmerged branch to try it ?
Thanks a lot!
pls update kotlin version
Getting the same issue mentioned here:
#12
...and the fix mentioned doesn't work for me. Using latest Soundpool 1.1.3.
/Users/<username>/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/soundpool-1.1.3/ios/Classes/SoundpoolPlugin.m:2:9: fatal error: 'soundpool/soundpool-Swift.h' file not found
We're using your sound plugin to play a beep every second for a breathing app (inhale/exhale) - for every second we play one beep, on the change from inhale to exhale we play an alternate pitched beep. Both sounds are loaded in soundloop and cached.
Is it possible to play the sounds in the background if the app is still running but the user goes swipes the app to the background? At the moment the app still ticks and the 1 second period timer keeps running, but the sounds generated by soundpool stops? - this is iOS only.
Could be related - when we bring the app back into the foreground, the beep which was last played is lost - to fix this we've had to run _loadSounds() again when the app is "resumed" - using the WidgetsBindingObserver
What I also noticed, is that in debug mode attached to android studio, the sound plays in the background - but when we go to profile or release the sounds stop when in the background.
I've tried to configure some background settings in the configuration within Xcode without luck.
Thanks in advance for any tips or tricks.
Great package, but I noticed on Android phone the sound is coming through the phone's ring tone and not the media channel. The result is you cannot use headphones on the phone.
Is there a way to define which channel the phone should use?
Launching lib/main.dart on iPhone X in debug mode...
Xcode build done. 1.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET soundpool OF PROJECT Pods WITH CONFIGURATION Debug ===
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
Could not build the application for the simulator.
Error launching application on iPhone X.
Exited (sigterm)
Hey there, I have a problem with playing notification sound when application works in background. I should play sound when application receives push notification from firebase, example:
static Future<dynamic> onBackgroundMessage(Map<String, dynamic> message) async {
final pool = Soundpool(streamType: StreamType.notification);
rootBundle.load('assets/new_offer_sound.mp3').then((value) => pool.load(value)).then((value) => pool.play(value));
}
and it crashes when I init Soundpool instance
Unhandled Exception: MissingPluginException(No implementation found for method initSoundpool on channel pl.ukaszapps/soundpool)
What i am doing wrong?
Steps to reproduce:
flutter build web
I use the following code
_pool = Soundpool(streamType: StreamType.notification);
_soundid = await rootBundle
.load("assets/178186__snapper4298__camera-click-nikon.wav")
.then((ByteData soundData) {
return _pool.load(soundData);
});
and later, when a button is pressed
pool.play(_soundid);
This works as expected. But the Device File Explorer shows, after some time, hundreds of files with names like sound8966442798867888692pool in data\data\myappname\cache.
Each file is only 88 kB, but the large number makes this irritating.
How can I get rid of this (except by re-installing the app)?
I am trying to stop the sound by calling the below function but the app is crashing
Future<void> _stopSound() async {
if (ringing != null) {
await _soundpool.stop(ringing);
}
}
Playing a sound works perfectly in iOS but on android when I play a longer sound like > 20 seconds the audio just cuts off sharply.
Pixel 3XL Android 11 (didn't work on Android 10 either)
Hi,
Thanks for this great library. Easy to use and very efficient.
Currently if we play an audio file, background music stops. You can test this while playing some music on spotify. This can be prevented by calling two simple methods on AVAudioSession sharedInstance:
AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.ambient, options: AVAudioSession.CategoryOptions.mixWithOthers)
AVAudioSession.sharedInstance().setActive(true)
It would be nice to have this functionality in soundpool.
Cheers.
D/voice_scence_discern(25716): add name:sample_rate, value:48000
V/voice_scence_discern(25716): add name:sample_rate value:48000 list:0x7d730d64c0
D/voice_scence_discern(25716): add name:channels, value:2
V/voice_scence_discern(25716): add name:channels value:2 list:0x7d730d64c0
D/voice_scence_discern(25716): get scence process pid:25716,
V/voice_scence_discern(25716): this process not in init apk. apk_list:0x7d28afe980
these sounds are not playing in some android devices using soundpool please help me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.