Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch File To Play A Song

I have a bit of a situation, I need to make a batch file play a song on a program I have made, but here is the catch, I need the player to be invisible, you must not see it, is there any way of doing this so the song will play once the end?

Thanks :D

like image 947
Petzl11 Avatar asked Dec 11 '22 09:12

Petzl11


2 Answers

Here is a Bat/VBS to play an audio file :

@echo off
set file=track12.mp3
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
  echo Sound.URL = "%file%"
  echo Sound.Controls.play
  echo do while Sound.currentmedia.duration = 0
  echo wscript.sleep 100
  echo loop
  echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs
like image 84
SachaDee Avatar answered Feb 08 '23 10:02

SachaDee


wv_player is a freeware player that can play audio media from a command prompt.

http://www.webxpace.net/

like image 23
foxidrive Avatar answered Feb 08 '23 10:02

foxidrive