mute playback before started

iOS, iPad, iPhone, tvOS specific usage questions
ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

mute playback before started

Postby ssbmaccom » 09 Oct 2016 14:30

Hi,

I am using TVVLCKit.framework, most often build locally due to some issues.

Users reported to me, that esp. with Audio-Passthrough they have distortion noise when switching from one stream to the other. It just takes a moment until the decoder gets in sync and playback is back to normal. But in a Home-Cinema environment this short distortion can ruin the equipment or the ears.

To get around that I wanted to mute the playback before playback is started and then with delay unmute again.
So I use [_mediaplayer.audio setMuted:YES]; after initializing the the media player.
Then with a delay of 0.2 seconds I use [_mediaplayer play]; to start playback on a background thread.
Finally I wanted to use [_mediaplayer.audio setMuted:NO]; to unmute the stream.

Well this does not work. Looks like muting only works, when playback has already started - which does not solve the issue reported by users of my App.

Any suggestions?

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: mute playback before started

Postby MidnightCoder » 09 Oct 2016 21:16

Look into passing the audio-track-to-play as an argument into the media/player. Similar to passing the audio-delay amount. I'm not sure how to do it exactly on VLCKit but with LibVLC in general, that is how you would do it before the player started playing.

Do post your solution if you do get it to work. Thanks!

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: mute playback before started

Postby ssbmaccom » 10 Oct 2016 18:05

Well... I do not want to reconfigure the audio track, I just want it muted.
And before playing the current audio channel might not even be available to disable and re-enable the right track.

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: mute playback before started

Postby MidnightCoder » 10 Oct 2016 19:58

What I meant is pass in track -1 as option into the media/player. This effectively mute the audio at start up and you can change the track number afterward.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: mute playback before started

Postby ssbmaccom » 11 Oct 2016 00:05

yes... just bad it needs to be done with this workaround.
Set -1 audio stream, then mute, then set desired audio stream, then unmute.
But how can I get the preferred audio stream, before the video is playing? currentAudio might not be set then.

But I will try.

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: mute playback before started

Postby MidnightCoder » 11 Oct 2016 04:25

-1 means mute already so don't need to mute and unmutes. Pseudo code:

1. pass -1 as audio track into media/player
2. Set media to player
3. Play()
4. Delay (x millisecond)
5. player.currentAudioTrackIndex = 0

Since zero is the default audio track (as if you skipped step 1-2 above), I think the end result is exactly what you wanted.

ssbmaccom
Cone that earned his stripes
Cone that earned his stripes
Posts: 184
Joined: 26 Nov 2015 15:21
Operating System: Mac OS, iOS, tvOS

Re: mute playback before started

Postby ssbmaccom » 11 Oct 2016 23:04

I will check on this esp. if the distortions do not happen, when changing the audio channel. I check with one of my testers. Otherwise I have to add mute and unmute as i mentioned...


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 10 guests