<div dir="ltr"><div class="gmail_default" style="font-family:'comic sans ms',sans-serif"><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">Hi ,</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br>Could you help me out on this , or guide me to some how can thanks <br><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif">I am trying to get a wav file information but Sndfile is unable to read file with special characters in path and file name(查找問題daw.wav) and i am unable to get information in any way , i tried passing file path to Sndfile with diferent encoding to but didnt work , but if i pass this 'C:\Users\Furqan\Desktop\test\DAW\1.wav' it works fine , Thanks is advance </font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">My Code is </font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"># -*- coding: UTF-8 -*-</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif">from scikits.audiolab import Sndfile</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">from os import walk, path, stat</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">track1 = r'C:\Users\Furqan\Desktop\test\查找問題daw\查找問題d.wav'</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">#track2 = r'C:\Users\Furqan\Desktop\test\DAW\1.wav'</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">try:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif"> track_one_file_obj = Sndfile(track1, 'r')</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">except:</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print('Simple didnt work')</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif"> pass</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif">try:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> track_one_file_obj = Sndfile(track1.decode('cp1252'), 'r')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">except:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print('cp1252 didnt work')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> pass</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br>
</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">try:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif"> track_one_file_obj = Sndfile(track1.encode('utf-8'), 'r')</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print(track_one_file_obj)</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">except:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print('encode didnt work')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> pass</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br>
</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br></font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif">try:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> track_one_file_obj = Sndfile(track1.encode('utf8'), 'r')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print(track_one_file_obj)</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif">except:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print('encode didnt work')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> pass</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"><br>
</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">try:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px">
<font face="comic sans ms, sans-serif"> track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print(track_one_file_obj)</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif">except:</font></div><div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> print('decode didnt work')</font></div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:13px"><font face="comic sans ms, sans-serif"> pass</font></div></div><div><br></div>-- <br><div dir="ltr"><span style="font-size:small"><br><font face="comic sans ms, sans-serif"><b>Best Regards</b></font></span><div>
<span style="font-size:small"><font face="comic sans ms, sans-serif"><b><br></b></font><font face="arial">Furqan Wasi</font></span><br style="font-family:arial;font-size:small"><b style="font-family:arial;font-size:small"><font color="#D5631D">AVPreserve </font></b><br>
</div><div><b style="font-family:arial;font-size:small"><font color="#D5631D"><br></font></b></div></div>
</div>