Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: AttributeError: cdata 'drmp3_config *' has no field 'outputChannels' #18

Closed
antimora opened this issue Jul 20, 2020 · 3 comments
Closed

Comments

@antimora
Copy link

Calling miniaudio.mp3_read_f32 results in error:

Traceback (most recent call last):
  File "/workspaces/ml/test6.py", line 4, in <module>
    decoded = miniaudio.mp3_read_f32(f.read())
  File "/home/dev/.local/lib/python3.8/site-packages/miniaudio.py", line 567, in mp3_read_f32
    config.outputChannels = want_nchannels
AttributeError: cdata 'drmp3_config *' has no field 'outputChannels'

Example Code:

import miniaudio

with open('common_voice_en_20603299.mp3', 'rb') as f:
    decoded = miniaudio.mp3_read_f32(f.read(), want_nchannels=1, want_sample_rate=16000)

Example File: common_voice_en_20603299.zip

Environment:

OS: Ubuntu 20.04
Lib Version:

Collecting miniaudio
  Downloading miniaudio-1.31.tar.gz (492 kB)
     |████████████████████████████████| 492 kB 3.0 MB/s 
Requirement already satisfied: cffi>=1.3.0 in /usr/local/lib/python3.8/dist-packages (from miniaudio) (1.14.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi>=1.3.0->miniaudio) (2.20)
Building wheels for collected packages: miniaudio
  Building wheel for miniaudio (setup.py) ... done
  Created wheel for miniaudio: filename=miniaudio-1.31-cp38-cp38-linux_x86_64.whl size=522066 sha256=318e1965eae33bdff2091fff6c8966503cab77c60a29800f2a0c463cf8451d45
  Stored in directory: /home/dev/.cache/pip/wheels/ce/ff/9a/844cb9c3f1fae09d3dad5731eeddedcc228938dca81e92eefa
Successfully built miniaudio
Installing collected packages: miniaudio
Successfully installed miniaudio-1.31
@irmen
Copy link
Owner

irmen commented Oct 30, 2020

Could you perhaps retry with the latest 1.36 version?

@antimora
Copy link
Author

@cameronmaske I am using a workaround and I haven't tried with updated libraries. Were you able to recreate the bug? I have outlined all the steps to recreate it. If this works, then you can close it. I also you add some unit tests to catch it because it seems the API was untested.

@irmen
Copy link
Owner

irmen commented Oct 31, 2020

You are right, I mistakenly assumed the problem was with the underlying miniaudio api itself. I have reproduced the problem and will fix the python wrapper interface

@irmen irmen closed this as completed in 07773a6 Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants