2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.voice.voicerss.internal.cloudapi;
15 import java.io.IOException;
16 import java.io.InputStream;
17 import java.util.Locale;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
23 * Interface which represents the functionality needed from the VoiceRSS TTS
26 * @author Jochen Hiller - Initial contribution
29 public interface VoiceRSSCloudAPI {
32 * Get all supported locales by the TTS service.
34 * @return A set of @{link {@link Locale} supported
36 Set<Locale> getAvailableLocales();
39 * Get all supported audio codecs by the TTS service. This includes MP3,
40 * WAV and more audio formats as used in APIs.
42 * @return A set of all audio codecs supported
44 Set<String> getAvailableAudioCodecs();
47 * Get all supported voices.
49 * @return A set of voice names supported
51 Set<String> getAvailableVoices();
54 * Get all supported voices for a specified locale.
57 * the locale to get all voices for
58 * @return A set of voice names supported
60 Set<String> getAvailableVoices(Locale locale);
63 * Get the given text in specified locale and audio format as input stream.
66 * the API key to use for the cloud service
68 * the text to translate into speech
72 * the voice to use, "default" for the default voice
74 * the audio codec to use
76 * the audio format to use
77 * @return an InputStream to the audio data in specified format
79 * will be raised if the audio data can not be retrieved from
82 InputStream getTextToSpeech(String apiKey, String text, String locale, String voice, String audioCodec,
83 String audioFormat) throws IOException;