Freesound add-on

About the empty panel, the API key has been moved to the user preferences. You should put there your key and validate it.

This a great add on. Works very well. It would be helpful if it would collect the attribution demands used, in a file or a copy/paste friendly window, so we would be able to easily add those correctly to our credits.

Thanks tin2tin, I will see if I can include such feature somehow, thanks for your suggestion!

@tin2tin, just in case you didn’t see it, while selecting a sound you can click on the info icon on the left and it will brings you to the sound page with all the info. I will add such info in a different way as well asap

I’ve ported the addon for blender 2.8

1 Like

I really like the concept - ability to have access to freesound lib directly from blender.
But for work it’s too much time consuming.
If you go directly for specific one track thats great, but if you search by keyword, than trying one by one is killing if its more than three sec and more.

Do I am right - sound plays after whole track is loaded?
(means - longer track - longer you have to wait for play preview?)

Is it possible to let play preview in the same way like on site - starts when cache is filled by enough amount of data for smooth play?
(Sorry for description, my english and tech knowledge of this is very low :slight_smile:

Also browsing on freesound site - I quite often use waveform to visually do “preselection” what sound could match my needs. I can’t imagine even how UI should looks like in blender … but I wanted to note here, because it helps me search faster.

Like I said, its awesome, but until browsing freesound site will be faster way, I stay stick to the browsing site from web browser … even download and import to blender process is much faster with your addon.

I wish you more luck with long time waited new blender’s asset manager. Probably it could be game changer for your addon as well?

It makes sense. But accessing such libraries with their API has some limitation. But thanks a lot of such ideas, it might help me to find some workaround. I’ve created such add-on mainly for fun and personal use but I can understand it’s not the best for doing some real work.

Yes, that’s how actually API works, if I haven’t missed something :wink:

Indeed. Keep in mind (if you missed it) there’s also the info icon which redirects you to the sound page when you can see all details.

Who knows :slight_smile: Things generally gets better in the future when it’s about open source world.

Thanks for accepting my patch to your very useful add-on.

If anyone is interested, this is the current 2.8+ UI:
image

I noticed that a preview waveform was mentioned above.
Apparently ffmpeg can render them:
https://trac.ffmpeg.org/wiki/Waveform
(But maybe it is overkill to set up a path to ffmpeg etc., and it will properly slow down the process of moving through files further)

You’re welcome, thanks for your time for testing and reporting bugs/improvements. In next days I will have some time to look at that :slight_smile:

Great idea for an addon!
I can’t wait to try it out, but unfortunately when I try to validate my Client secret/API key, I get a stack trace… :sob:

(I generated the key from: https://freesound.org/apiv2/apply)
Blender v2.82

location: <unknown location>:-1
Error: Traceback (most recent call last):
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 1244, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 1290, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 1239, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/http/client.py", line 1414, in connect
    server_hostname=server_hostname)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/ssl.py", line 423, in wrap_socket
    session=session
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/ssl.py", line 870, in _create
    self.do_handshake()
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/ssl.py", line 1139, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/***/.config/blender/2.82/scripts/addons/freesound/freesound.py", line 290, in execute
    s = self.client.check_access()
  File "/home/***/.config/blender/2.82/scripts/addons/freesound/freesound_api.py", line 75, in check_access
    request = FSRequest.request(uri, {}, self, Sound)
  File "/home/***/.config/blender/2.82/scripts/addons/freesound/freesound_api.py", line 213, in request
    f = urlopen(req)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/media/***/Ubuntu 18_04_1 LTS amd64/blender/blender_bins/blender-2.82-dfe965bee24d-linux-glibc217-x86_64/2.82/python/lib/python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)>

location: <unknown location>:-1

That’s fixed now. I will have to rewrite some part as well, since it’s using deprecated python library.

1 Like

Thank you! :smiley:

Hi.

Blender version: 2.82a
Addon version: 2.0 (I downloaded the Github repository as ZIP file)

As soon as I try to install the addon (before I can tick the checkbox to activate it), I got this error:

Traceback (most recent call last):
  File "E:\blender\blender_official\2.82\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'freesound-freesound-2'

EDIT : Then I noticed that there is a Releases page on the Github repository.
Using this ZIP file instead also makes the error also appear.

.
.


.
.

I have noticed that even if I couldn’t enable the addon, in the Addon Preferences, you didn’t add this line in the bl_info paragraph:

"tracker_url": "https://blenderartists.org/t/freesound-add-on/671946",

I tend to think that such a button can be useful for users to be able to directly visit this forum, to quickly report bugs and ask for new features.

It’s generally better to report bugs on github. https://github.com/iwkse/freesound/issues/7 is your issue which should have been fixed already.
I added the tracker_url as well though.

1 Like

Excuse me, but if the issue was already known and fixed 4 days ago, why, when I download the GitHub repository (or the ZIP file from the Releases page), I still get this error when I try to install the add-on? Couldn’t this bug still be there? (I am just trying to figure out if the problem is on my end or if it’s the add-on).

About reporting issues on Github, I apologize, I didn’t pay enough attention to the Github bug tracker ; sometimes addon developers prefer users to report bugs here on this forum, others prefer on Github. If I find other bugs, I assure you that from now on, I will post them on Github.

I thought it was fixed but it’s not. I’m looking at it.
It’s okay to report here as well, just saying I prefer github :slight_smile:

I think I know why.

When I try to download the ZIP file from the Github repository (from this branch https://github.com/iwkse/freesound/tree/freesound-2.0):
I click on this Download ZIP button:
Annotation 2020-04-10 142953

And at the bottom of my web browser (Firefox), here is where link points to:

bottomfirefox

And when I go to the Releases page, it seems that the file is the same.

It seems that hovering the Source Code (.zip) file leads to the same location.

To sum up: I don’t understand why the Download ZIP button on the Github repository doesn’t download the repository but the archive file (that dates back to 4 days ago). For some reason, I can’t download the repository that has the new __init__.py file (1 hour ago).

No it’s not related to that. The issue is the folder name. If you rename it to freesound it will work. Now the fix I want is to let it work for any folder name (if possible)

1 Like

You can give a try now. The issue is about the - and . in the folder name. I’ve created a new release with a proper name

This time when I retried to download the zip file:

Annotation 2020-04-10 152825

1 Like