TEXT to MUSIC API

ÜCRETLİ
Taraf Manolis Teletos | Güncelleyen 2 mesi fa | Music
Popülerlik

7.6 / 10

Gecikme

3,122ms

Hizmet Düzeyi

100%

Health Check

93%

Tüm Tartışmalara Dön

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

Rapid account: Armaanjain 11110
armaanjain11110
un anno fa

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

Rapid account: Manosteletos
manosteletos Commented 6 mesi fa

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 un anno fa

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

Aşağıya yorum ekleyerek tartışmaya katılın:

Yeni yorumlar göndermek için giriş yapın / kaydolun