iOS Development

android – Flutter audio not taking part in on linked audio gadget(Airpods/bluetooth audio system) however solely on cellphone foremost speaker

Pubspec.Yaml file

title: relationsguiden
description: App.
model: 1.0.0+2
setting:
  sdk: ">=2.7.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  shared_preferences: ^2.0.13
  http: ^0.13.4
  url_launcher: ^6.0.20
  path_provider: ^2.0.9
  in_app_purchase: ^3.0.2
  signalr_client: ^0.1.6
  audioplayers: ^4.1.0
  flutter_local_notifications: ^12.0.3

  firebase_messaging: ^14.0.4
  cupertino_icons: ^1.0.5

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
  property:
    - photos/

Code to run the audio file.

  void _clickedPlayIcon(IntroTileType sort) async {
    if (this._currentType == sort) {
      if (this.audioPlayer.state == PlayerState.paused) {
        await this.audioPlayer.resume();
        setState(() => this._playerState = App.PlayerState.taking part in);
        return;
      } else if (this.audioPlayer.state == PlayerState.taking part in) {
        await this.audioPlayer.pause();
        setState(() => this._playerState = App.PlayerState.paused);
        return;
      }
    }

    if (this._currentType != null) {
      await this.audioPlayer.cease();
    }

    String url;
    if (sort == IntroTileType.cheated) url="https://dev.recaptureit.se/relationsguiden/relationsguidenapi/Sound/Introduction/letDown.mp3";
    if (sort == IntroTileType.letDown) url="https://dev.recaptureit.se/relationsguiden/relationsguidenapi/Sound/Introduction/letDown.mp3";
    if (sort == IntroTileType.forestall) url="https://dev.recaptureit.se/relationsguiden/relationsguidenapi/Sound/Introduction/letDown.mp3";
    if (sort == IntroTileType.suspect) url="https://dev.recaptureit.se/relationsguiden/relationsguidenapi/Sound/Introduction/letDown.mp3";
    if (sort == IntroTileType.accountability) url="https://dev.recaptureit.se/relationsguiden/relationsguidenapi/Sound/Introduction/letDown.mp3";

    if (url == null) return;

    setState(() {
      this._currentType = sort;
      this._playerState = App.PlayerState.loading;
    });

    await audioPlayer.play(UrlSource(url));
    return;      
  }

Physician abstract:

[✓] Flutter (Channel secure, 3.7.7, on macOS 13.3.1 22E261 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android gadgets (Android SDK model 33.0.0-rc4)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the net
[✓] Android Studio
[✓] Android Studio (model 2022.3)
[✓] Android Studio (model 3.5)
[✓] Related gadget (3 obtainable)
[✓] HTTP Host Availability

• No points discovered!

Audio challenge solely on iOS not on Android.

Credit: www.ismmailgsm.com

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button