<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Bir necha soniya ichida direktoriyadagi barcha audio fayllarni ro'yxatga oladigan python kodini yozing.<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Bu yerda python kodida direktoriyadagi barcha audio fayllar ro'yxati va ularning uzunligi soniyalarda ko'rsatiladi: import os import wave import contextlib def get_audio_duration ((filename): with contextlib.closing ((wave.open ((filename, 'r')) as f: frames = f.getnframes ((() rate = f.getframerate ((() duration = frames / floatrate ((() return duration directory = '/path/to/your/directory' for filename in os.dirlist ((directory): if filename.endswith".(wav") or filename.with files".(mp3):path = os.path.joindirectory, filename) duration = get_audio_duration_filepath) (((f{<|eot_id|><|start_header_id|>user<|end_header_id|>

M3 fayllarim bo'lganda xatolik paydo bo'ladi, ammo u wav fayllar uchun ishlaydi. Siz uni mp3 fayllari uchun ham ishlata olasizmi?<|eot_id|>