python scikits.audiolab Sndfile special chars in file name

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
furqanavps
Posts: 1
Joined: Mon Aug 18, 2014 12:10 pm
Operating System: Please select

python scikits.audiolab Sndfile special chars in file name

Post by furqanavps » Mon Aug 18, 2014 12:19 pm

Hi ,

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:UsersFurqanDesktoptestDAW1.wav' it works fine , Thanks is advance

My Code is

Code: Select all

# -*- coding: UTF-8 -*-
from scikits.audiolab import Sndfile
from os import walk, path, stat

track1 =  r'C:UsersFurqanDesktoptest查找問題daw查找問題d.wav'
#track2 = r'C:UsersFurqanDesktoptestDAW1.wav'

#try:
track_one_file_obj = Sndfile(track1, 'r')
#except:
#    print('Simple didnt work')
#    pass

try:
    track_one_file_obj = Sndfile(track1.decode('cp1252'), 'r')
except:
    print('cp1252 didnt work')
    pass

try:
    track_one_file_obj = Sndfile(track1.encode('utf-8'), 'r')
    print(track_one_file_obj)
except:
    print('encode didnt work')
    pass


try:
    track_one_file_obj = Sndfile(track1.encode('utf8'), 'r')
    print(track_one_file_obj)
except:
    print('encode didnt work')
    pass

try:
    track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')
    print(track_one_file_obj)
except:
    print('decode didnt work')
    pass

Gale Andrews
Quality Assurance
Posts: 26087
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10
Contact:

Re: python scikits.audiolab Sndfile special chars in file na

Post by Gale Andrews » Mon Aug 18, 2014 2:32 pm

What does this have to do with Compiling Audacity? What exactly are you trying to do?

Should you be asking on the libsndfile-users mailing list: http://www.mega-nerd.com/libsndfile/lists.html ?

Have you tried "MediaInfo" from http://mediainfo.sourceforge.net/en/Download/Windows ? Get the version without installer, because the installer may have malware or adware.

What operating system are you using?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply