Project

General

Profile

$sound » History » Version 6

Per Amundsen, 02/23/2023 07:40 PM

1 1 Per Amundsen
_Added in 3.3_
2
3
*$sound(filename)*
4
5
Returns "ID3 tag":https://en.wikipedia.org/wiki/ID3 information about a file/song.
6
7 5 Per Amundsen
_If file is not found, the default sound folder associated with the file extension is returned._
8 1 Per Amundsen
9
_Same as [[$mp3]]._
10
11
*Parameters*
12
13 6 Per Amundsen
table(ktable).
14
|*Parameter*|*Description*|
15
| filename | Filename to check. |
16 1 Per Amundsen
17
*Properties*
18
19 6 Per Amundsen
table(ktable).
20
|*Property*|*Description*|
21
| .album | Album name. |
22
| .title | Song title. |
23
| .artist | Song artist. |
24
| .year | Album/song year. |
25
| .comment | Comments field. |
26
| .genre | Song genre. |
27
| .track | Album track, |
28
| .length | Song length. |
29
| .bitrate | Song bitrate. |
30
| .version | "MPEG":https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group version. |
31
| .variable | [[$true]] if the song is "variable bitrate":https://en.wikipedia.org/wiki/Variable_bitrate, otherwise [[$false]]. |
32
| .sample | "MPEG":https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group frequency rate. |
33
| .mode | "MPEG":https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group mode. |
34
| .layer | "MPEG":https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group layer. |
35
| .copyright | [[$true]] if copyright field is enabled, otherwise [[$false]]. |
36
| .private |  [[$true]] if private field is enabled, otherwise [[$false]]. |
37
| .vbr | [[$true]] if the song bitrate is variable, otherwise [[$false]]. |
38
| .id3 | Returns the "id3":https://en.wikipedia.org/wiki/ID3 tag version. |
39
| .tag | Returns the number of "id3v2":https://en.wikipedia.org/wiki/ID3 tags found. |
40
| .tags | Returns the "id3v3":https://en.wikipedia.org/wiki/ID3 tags found. |
41
| .crc | Returns [[$true]] if the file is "CRC protected":https://en.wikipedia.org/wiki/Cyclic_redundancy_check, otherwise [[$false]]. |
42 1 Per Amundsen
43
*Example*
44
45
<pre>
46
; Print artist - title - album for 'song.mp3'
47 2 Per Amundsen
//echo -ag $sound(song.mp3).artist- $sound(song.mp3).title - $sound(song.mp3).album
48 1 Per Amundsen
</pre>