TEXT to MUSIC API

PAGADO
Por Manolis Teletos | Actualizada 2 महीने पहले | Music
Popularidad

7.6 / 10

Latencia

3,122ms

Nivel de servicio

100%

Health Check

93%

Volver a todas las conversaciones

What Type of response is it giving and how can I read it as .mp3 ?

Rapid account: Armaanjain 11110
armaanjain11110
एक वर्ष पहले

it is giving me some weird symbols as response. how can i parse it ?

Rapid account: Manosteletos
manosteletos Commented 6 महीने पहले

Arman the mp3 version is out . In python you can parse it like this :

import http.client

conn = http.client.HTTPSConnection(“text-to-music-api.p.rapidapi.com”)

headers = {
‘X-RapidAPI-Key’: “XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”,
‘X-RapidAPI-Host’: “text-to-music-api.p.rapidapi.com
}

conn.request(“GET”, “/play?ascii_text=IaMaTextThatWillGiveMusic”, headers=headers)

res = conn.getresponse()
if res.status == 200:
# Save the response content (MIDI or MP3 data) to a local file
with open(“output”, “wb”) as file:
file.write(res.read())
print(“MIDI or MP3 file saved as output”)
else:
print(“Failed to retrieve the file. Status code:”, res.status)

Rapid account: Manosteletos
manosteletos Commented एक वर्ष पहले

Hello Arman.

The response is in .mid format and instantly it downloads it to your browser.
Convert MIDI to audio: MIDI files contain musical instructions, but they do not contain actual audio data. To convert MIDI to audio, you’ll need to use a software or library that can interpret the MIDI instructions and generate audio output. One popular library for this purpose is FluidSynth.
In future version in July I plan to choose what type of response you want to download in this case .mp3.

Thanks for your comment.

Emmanuel

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios