Hướng dẫn php mp3 player

my php code to fetch all sound files, random way, in a folder is this:

$files = glob("audio/*.mp3");
$random = $files[array_rand($files)];

and to play them i use:


What i want is to play the sound files pressing a HTML button tag and not seeing the default HTML5 audio player. Just like Spotify or similar.

I tried making it with button onclick="function()" but with javascript wich is a client language i don't know a way to loop all files in my folder, just like i did with the php code above.

Any ideas? Many thanks...

asked Jul 4, 2015 at 19:26

Hướng dẫn php mp3 player

André CastroAndré Castro

1,4076 gold badges32 silver badges58 bronze badges

5

Few minutes after asking i solved the question by myself. Been dealing with this four a couple of hours, so here it is:


Used the browser DOM and a html special caracter & #9658;. It does the trick, in spite of not allowing the use of an icon image.

Thanks to all :)

answered Jul 4, 2015 at 20:03

André CastroAndré Castro

1,4076 gold badges32 silver badges58 bronze badges

Traditional Vietnamese musical instruments are the musical instruments used in the traditional and classical musics of Vietnam. They comprise a wide range of string, wind, and percussion instruments, used by both the Viet (Kinh) majority as well as the nation's ethnic minorities.

 


Đàn bầu - monochord zither

Đàn bầu - monochord zither was a very simple instrument comprised of a bamboo section, a flexible rod, a calabash or half a coconut. After a process of evolution and improvement, the present form of the dan bau is a bit more sophisticated, yet still quite simple. It consists of an oblong box-shaped sound board, slightly narrower toward one end, with a slightly warped top made of unvarnished soft light wood, sides made of hard wood, and a bottom of light wood pierced with holes for better sound. At one end of the sound board is a flexible bamboo rod that goes through a dried calabash whose bottom end has been cut out before being fixed on the sounding board. At the other end of the sounding board is a peg made of wood or metal used for tuning . The metal string, is attached to the rod and to the peg. The pluck is a pointed stick of bamboo or rattan.

The notes played by the dan bau are smooth, sweet, and captivating. In recent years success has been achieved in amplifying the sound, causing an increase in volume and distance the that the sound carries, while still preserving the quality of the sound.

The instrument is played solo or to accompany a poetry recital. During recent years, it has taken a role in orchestral accompaniment to cheo and cai luong opera. The dan bau has been performed on major stages in foreign countries.


Đàn đáy - long-necked three-stringed lute with trapezoidal body


Đàn tranh - long zither

The tranh zither is also called the thap luc cam or sixteen-stringed zither. The tranh zither appeared in Vietnam in the time of the Tran dynasty (12th-13th centuries).

It has a rectangular sounding box, about 110 centimetres long that tapers about 13 cm toward an end , with a warped sound board made of unvarnished light wood. The sides are made of hard wood decorated with various designs, either lacquered or inlaid with mother-of-pearl. The bottom is made of light wood with sound holes. The broader end of the sound box is pierced with 16 holes and reinforced with a metal band. Toward the middle of the sound board there are 16 bridges made of wood or bone tipped with copper that can be moved to vary the tension of the strings, thus creating various notes. At the narrower end of the box are sixteen pegs for tuning. The strings are metal and tuned to the pentatonic scale. The range of the tranh zither is about three octaves, from the notes C to C3.

The player uses a plectrum and can play chords, trills, tremolos... Her left hand, which manipulates the strings, can use such techniques such as pressing, vibrato, glissando, etc. The music of the tranh zither is usually light and full of cheerfulness.

The instrument bears some likeness to the Japanese koto, the Korean Kayagum, the Mongolian Jatac, the Chinese Zeng, and the Indonesian Kachap, which have 13, 12, 12, 13-16, 7-24 strings, respectively. It is nonetheless an original Vietnamese instrument with specific musical characteristics. It is used to accompany poetry recitals and is quite often part of an orchestra or a band playing chamber music, religious music.


Đờn Cò (Đàn Nhị)

 


Đàn sến - two-string lute

Đàn tứ dây - bass guitar in the shape of a đàn đáy


Đàn Đoàn

Dan Doan has a shape of the sun (bigger than the moon). Therefore, sometimes people call it - Dan Nhat (Dàn Nhâ.t).

It has 2 strings, a very short neck, and the frets are right on the resonator box.


Đàn nguyệt (also called nguyệt cầm or đàn kìm) - moon-shaped two-string lute

According to ancient carvings, the moon-shaped lute appeared in Vietnam in the 11th century. Intended to be played by men, the lute has maintained a very important position in the musical traditions of the Kinh. Therefore, this instrument is widely used in their folk, court, and academic music.

The dan nguyet is distinguished by its pure and loud sound, as well as by its great capacity to express different emotions. Thus, it is heard at solemn and animated ritual concerts, funerals, or refined chamber music recitals.

It can be played in solo, as part of an orchestra, or to accompany other instruments. Due to its long neck and high frets, the dan nguyet is also used as an ornament

Đàn Tam

Đàn tam là nhạc cụ Việt Nam có 3 dây. Trước đây người ta thường dùng nhạc cụ này trong dàn nhạc bát âm. Ngày nay phần lớn các dàn nhạc đều có đàn tam với đủ loại kích thước, từ nhỏ, vừa đến lớn và cả loại đàn tam âm trầm, hòa điệu với những nhạc cụ âm trầm khác trong dàn nhạc. Cả 3 loại đàn tam kể trên đều thể hiện âm vực trong vòng 2 quãng tám rất tốt.


Đàn tỳ bà - pear-shaped lute with four strings


Sáo HMông ( Flute )

The bamboo flute has long been attached to the cultural and spiritual life of the Vietnamese. It can be said that the bamboo flute contains the musical essence of the Vietnamese countryside together with the four tranquil seasons.

The bamboo flute is made from the stem of fine bamboo with a diameter of 1.5cm and a length of about 30cm. On the stem there is one mouth piece and 10 finger holes. It has piercing upper ranger which sound could cuts through the large ensemble.