Skip to content
Live Streaming

Room music

Play a song from the host's phone to a live room.

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 VoxeraLiveRoomConfig.roomMusicMode:

VoxeraRoomMusicMode.track (default)VoxeraRoomMusicMode.aux
How it's sentOn a second track, room-musicMixed into the microphone, after echo cancellation
Listeners can mute only the musicYesNo
Data per listenerAbout 50 MB per hourAbout 31 MB per hour at 48 kbps
Mic buttonMutes the voiceMutes the voice, and the song keeps going

In aux mode, a host mute silences both the voice and the song.