/// <summary> /// Play audio file by url /// </summary> /// <param name="instance">>Instance of <see cref="IPlayAudio" /></param> /// <param name="id">ID of bridge, call, conference, etc</param> /// <param name="fileUrl">Url to file to play</param> /// <param name="tag">A string that will be included in the events delivered when the audio playback starts or finishes</param> /// <param name="cancellationToken"> /// Optional token to cancel async operation</param> /// <returns>Task instance for async operation</returns> /// <example> /// <code> /// await client.Bridge.PlayAudioFileAsync("bridgeId", "http://host/path/to/file.mp3"); /// </code> /// </example> public static Task PlayAudioFileAsync(this IPlayAudio instance, string id, string fileUrl, string tag = null, CancellationToken?cancellationToken = null) { return(instance.PlayAudioAsync(id, new PlayAudioData { FileUrl = fileUrl, Tag = tag }, cancellationToken)); }
public ListTabbedPageModel() { if (tracksList.Count == 0) { audioService = DependencyService.Get <IPlayAudio>(); tracksList = audioService.GetTrackModelList(); Items = tracksList.OrderBy(x => x.Artist).ToList(); } }
/// <summary> /// Speak a sentence /// </summary> /// <param name="instance">Instance of <see cref="IPlayAudio" /></param> /// <param name="id">ID of bridge, call, conference, etc</param> /// <param name="sentence">The sentence to speak</param> /// <param name="gender">The gender of the voice used to synthesize the sentence.</param> /// <param name="voice">The voice to speak the sentence.</param> /// <param name="locale">The locale used to get the accent of the voice used to synthesize the sentence.</param> /// <param name="tag">A string that will be included in the events delivered when the audio playback starts or finishes</param> /// <param name="cancellationToken"> /// Optional token to cancel async operation</param> /// <returns>Task instance for async operation</returns> /// <example> /// <code> /// await client.Bridge.SpeakSentenceAsync("bridgeId", "Hello"); /// </code> /// </example> public static Task SpeakSentenceAsync(this IPlayAudio instance, string id, string sentence, Gender gender = Gender.Female, string voice = "susan", string locale = "en_US", string tag = null, CancellationToken?cancellationToken = null) { return(instance.PlayAudioAsync(id, new PlayAudioData { Sentence = sentence, Gender = gender, Voice = voice, Locale = locale, Tag = tag }, cancellationToken)); }
public StartPlayerPageModel() { audioService = DependencyService.Get <IPlayAudio>(); }