audio player

 

[Ko]

How to Play Multiple Sounds

 - flutter package 사이트에서 audio file player 검색해서 audio player 설치하고, local asset 음원 플레이를 지원하는 audio cache 이용하자. --> 각 버튼이 다양한 사운드를 플레이하도록 하자.

 - 아래 사이트에서 무료 음원을 다운로드 받아서 필요한 app 만들 있음.

https://freesound.org/

 - final code

  void playSound(int soundNumber) {

    final player = AudioCache();

    player.play('note$soundNumber.wav');

  }

              FlatButton(

                color: Colors.red,

                onPressed: () {

                  playSound(1);

                },

              ),

              FlatButton(

                color: Colors.orange,

                onPressed: () {

                  playSound(2);

                },

              ),

...

 

[En]

How to Play Multiple Sounds

 - Search for the audio file player on the flutter package site, install the audio player, and use an audio cache that supports local asset sound source play. -> Let each button play a variety of sounds.

 - Download the free sound source from the site below to create the app you need.

https://freesound.org/

 - final code

  void playSound(int soundNumber) {

    final player = AudioCache();

    player.play('note$soundNumber.wav');

  }

              FlatButton(

                color: Colors.red,

                onPressed: () {

                  playSound(1);

                },

              ),

              FlatButton(

                color: Colors.orange,

                onPressed: () {

                  playSound(2);

                },

              ),

...

'플러터(Flutter) > 플러터 패키지(Flutter Package)' 카테고리의 다른 글

Admob test device registration  (0) 2020.05.11
Flutter local notification  (0) 2020.03.19
geolocator  (0) 2020.03.19
Dart Package  (0) 2020.03.18

+ Recent posts