Live Audio Room
Room music
Play a song from a phone to the room, on its own track or mixed with the microphone.
controller.music plays a song from this phone to the room.
final music = controller.music;
await music.start(path: cachedSongFile); // a downloaded server song works the same way
music.setPublishVolume(0.8); // what the room hears
music.setPlayoutVolume(0.5); // this phone's speaker
await music.pause();
await music.resume();
await music.seek(const Duration(seconds: 30));
music.onFinished.listen((_) {
// next song
});
await music.stop();Choose a mode
Set VoxeraAudioRoomConfig.roomMusicMode:
VoxeraRoomMusicMode.track (default) | VoxeraRoomMusicMode.aux | |
|---|---|---|
| How it's sent | On a second track, room-music | Mixed into the microphone, after echo cancellation |
| Listeners can mute only the music | Yes | No |
| Data per listener | About 50 MB per hour | About 31 MB per hour at 48 kbps |
| Mic button | Mutes the voice | Mutes the voice, and the song keeps going |
In aux mode, a host muting the seat silences both the voice and the song, and unmuting brings the song back.