下载 人自由的桌面上,你自己个人的机器人你的电脑或Mac
Self, AIML, and scripting

making a web-radio player?

通过 ronxtcdabass 发布 Jun 13 2022, 16:30

Hello!

can someone help me with this?

i tried to modify the "musicplayer" script for playing my favoriteradio station, but what must i do now?

where must i put this to let my bot play?

(english is not so easy for me. my mothertongue is german.)

 


greeting: Hello there. wanna hear some of my favorite  stations?  default: Sorry, but I do not understand. try something other. play #play_music play music "

What radio station would you like?:

 

 

 

" label: #play_music keywords: music audio play start GlobalBeats FM - Green Channel playing GlobalBeats FM command: { type: "music", cmd: "play", genre: "GlobalBeats FM", url: "http://gbs03.de:7120" } poses: dancing Suburbs of Goa: [SomaFM] playing Suburbs of Goa command: { type: "music", cmd: "play", genre: "Suburbs of Goa", url: "http://ice1.somafm.com/suburbsofgoa-128-mp3" } poses: dancing Babaganousha Radio playing Babaganousha Radio command: { type: "music", cmd: "play", genre: "Babaganousha Radio", url: "http://babaganousha.net:8000" } poses: dancing Hirschmilch psytrance playing Hirschmilch psytrance command: { type: "music", cmd: "play", genre: "Hirschmilch psytrance", url: "http://hirschmilch.de:7000/psytrance.mp3" } poses: dancing Hirschmilch progressive playing Hirschmilch progressive command: { type: "music", cmd: "play", genre: "Hirschmilch progressive", url: "http://hirschmilch.de:7000/progressive.mp3" } poses: dancing pause paused... keywords: pause stop command: { type: "music", cmd: "pause", url: "https://rfcmedia.streamguys1.com/MusicPulse.mp3" } poses: default


by admin posted Jun 13 2022, 17:24
Please include a link to the musicplayer script you are trying to modify.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 557, today: 0, week: 0, month: 8

by ronxtcdabass posted Jun 20 2022, 12:11

The idea comes from:

https://www.botlibre.com/script?id=36415757   and

https://www.botlibre.com/script?id=36393269 

in the example it works only with this website.

In the code from the first link are only entries to ***.mp3 so i tried with other files and it worked, but not with radiostreams...


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 564, today: 0, week: 1, month: 13

by admin posted Jun 21 2022, 8:53

So the bot in this script uses "commands" in Bot Libre to pass back the audio commands to the client.

Your web or mobile client needs to process these commands to play the audio.

In the example website it uses some JavaScript code to process the audio command, you need this code for you bot to play audio.

var audio = new Audio();
function PlayMusic() {
this.updateAvatar = function(response) {
if (response.command != null) {
var command = JSON.parse(response.command);
console.log(command);
if (command.cmd == "play") {
audio.pause();
audio.src = command.url;
audio.play();
} else if (command.cmd == "pause") {
audio.pause();
}
}
}
}

web.game = new PlayMusic();

Thumbs up: 1, thumbs down: 0, stars: 5.0
Views: 565, today: 1, week: 1, month: 12

by ronxtcdabass posted Jun 21 2022, 12:55

WOW!!!!

 

thank you for the fast help!

it works...

edited: it works in my html file at my PC but online at my webspace works only [Soma FM] ...

my testpage: Test


Updated: Jun 21 2022, 14:47
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 544, today: 1, week: 1, month: 10

Id: 43374659
标签: how to, music, radio
发布: Jun 13 2022, 16:30
答复: 3
的风景: 634, 今天: 2, 周: 2, 一个月: 14
0 0 0.0/5