LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-29-2017, 08:51 AM   #1
ArneVanP
LQ Newbie
 
Registered: Dec 2017
Posts: 5

Rep: Reputation: Disabled
My Music player not working


Hi evryone,

I'm writing a script in bash that needs to play music for me but I can't figure out what's not working. Evrything works accept the displaying of the music array

As extentions I have installed dialog and mpg321

this is the script as far
Code:
#!/bin/bash
werkmap=$1	#Eerste paramater is de werkmap
cd $werkmap

muzieklijst=`ls $werkmap -R | grep \.mp3$` 	#lijst met muziekbestandsnamen
muziekpadlijst=`find -name "*.mp3"`		#lijst met paden van de muzieksbestanden

declare -a muziekarray				#een array maken voor de bestandsnamen
declare -a muziekpadarray			#een array maken voor de paden

#bestandsnamen opslaan in muziekarray
N=0
for i in $muzieklijst ; do

	muziekarray[$N]="$i"
	let "N=$N+1"
done

#paden opslaan in muziekpadarray
M=0
for i in $muziekpadlijst ; do
	
	muziekpadarray[$M]="$i"
	let "M=$M+1"
done

while [ 1 ]
do

dialog --menu "Kies met pijltjes, muis of de bijhorende toets, druk dan op enter." 25 75 4 \
Muziekspeler "Speel alles af in de werkmap recursief" \
Playlistspeler "Speel een playlist af" \
Playlistmaker "Maak een playlist" \
Help "Instructies over het gebruik van dit script" 2> menuitem.txt

menuitem=`cat menuitem.txt`

case $menuitem in
	Muziekspeler) 
		dialog --menu "Kies een liedje" 25 75 ${#muzieklijst[@]} \
		for i in $muzieklijst ; do
			fprint muziekarray[$i]
		done
		;;
	Playlistspeler) 
		speler=2
		;;
	Playlistmaker) 
		speler=3
		;;
	Help) 
		dialog --title "Help" --msgbox "Om het programma te sluiten, druk op het kruisje rechts bovenaan." 50 50
		;;
esac


done

Last edited by ArneVanP; 12-29-2017 at 08:53 AM.
 
Old 12-29-2017, 11:14 AM   #2
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 28
A bit off topic.

Do you know about cvlc (command line video lan client)?
 
Old 12-29-2017, 11:19 AM   #3
ArneVanP
LQ Newbie
 
Registered: Dec 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by _roman_ View Post
A bit off topic.

Do you know about cvlc (command line video lan client)?
The problem is that I cannot use any other extentions then the one's i am already using
 
Old 12-30-2017, 04:19 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 9,732
Blog Entries: 7

Rep: Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401Reputation: 2401
Code:
fprint muziekarray[$i]
i don't think this is bash.

i'd use
Code:
echo "${muziekarray[i]}
 
Old 01-02-2018, 02:11 AM   #5
rhubarbdog
Member
 
Registered: Apr 2015
Location: Yorkshire, England
Distribution: Linux Mint
Posts: 134

Rep: Reputation: Disabled
I have 2 commands on my system 'play' and 'aplay'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nuclear Music Player for Multi Source Music Streaming in Linux LXer Syndicated Linux News 0 09-30-2017 02:00 PM
Any music player that can shuffle by work? [for classical music] Archy1 Linux - Software 6 03-25-2017 01:05 AM
LXer: Play your Music on Linux with Music Player Daemon LXer Syndicated Linux News 0 03-03-2014 06:41 PM
LXer: Encode and sync music to your portable music player in linux LXer Syndicated Linux News 0 09-15-2009 08:40 AM
LXer: Exaile Music Player - Music Player for GTK+ in openSUSE LXer Syndicated Linux News 0 08-31-2008 12:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration