<s>[INST] Write a python code that lists all audio files in a directory in seconds. [/INST] Sure, you can first list all the files then select the audio files.

Here is how to list all the files (the runtime will depend on how many files you have):

```python
from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
```

Now you can filter `onlyfiles` to only keep audio files, to do that tell me which extensions you expect (such as ".mp3", ".wav", etc.)</s>\ <s>[INST] Can this be applied to any extention such as a jpg, bmp, txt? Or just music? [/INST] It can be applied to any set of files you wish as long as you know the extension. So if a text file has the somewhat more rare used extension asc, then you will not find it, if you are only looking for ".txt".</s>