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

Changing file_path in audio.py example is not working #356

Closed
Akash3194 opened this issue Jul 22, 2017 · 5 comments
Closed

Changing file_path in audio.py example is not working #356

Akash3194 opened this issue Jul 22, 2017 · 5 comments

Comments

@Akash3194
Copy link

Akash3194 commented Jul 22, 2017

I am trying to change file path of audio, but its not working, It always shows me the error when i use this;-

file_path = '/sdcard/audio1.mp3'
audio.file_path = file_path

@Akash3194 Akash3194 changed the title Changing filepath name in audip example is not working Changing file_path in audio.py example is not working Jul 22, 2017
@sumitmadhwani
Copy link
Contributor

@Akash3194 what is the error you are getting ? Please share the logs.

@Akash3194
Copy link
Author

Akash3194 commented Jul 22, 2017

here is the code:
import os

from plyer import audio
audio.file_path
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/plyer-1.3.1.dev0-py3.5.egg/plyer/utils.py", line 88, in _ensure_obj
mod = import(module, fromlist='.')
ImportError: No module named 'plyer.platforms.linux.audio'
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/plyer-1.3.1.dev0-py3.5.egg/plyer/utils.py", line 88, in _ensure_obj
mod = import(module, fromlist='.')
ImportError: No module named 'plyer.platforms.linux.audio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/plyer-1.3.1.dev0-py3.5.egg/plyer/utils.py", line 102, in getattribute
object.getattribute(self, '_ensure_obj')()
File "/usr/local/lib/python3.5/dist-packages/plyer-1.3.1.dev0-py3.5.egg/plyer/utils.py", line 94, in _ensure_obj
obj = facade()
TypeError: init() missing 1 required positional argument: 'file_path'

I don't know i am making some mistakes or what, i am a begginer so facing problems.Please help.

@sumitmadhwani
Copy link
Contributor

Are you trying to execute this code in a platform other than android ?
I tested the feature in android and it worked fine for me. It will give you an error in any other platform because API for any platform other than Android is not yet implemented.

@Akash3194
Copy link
Author

I tried it on Linux. I added that code in the program and made its apk but app is not working in android please tell me each n every step. What to do i am getting confused and thanx for helping me. You are doing a very good job @Malverick

@sumitmadhwani
Copy link
Contributor

@Akash3194 first of all, try to build the apk for the demo example which is there for Audio Recording in plyer repo. See if it works fine for you then try to run your custom code.

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