Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by McRonald · Jan 19, 2015 at 07:41 PM · c#importpluginc# dll

Does LibSpotify SDK crashes Unity3D?

The past few days im trying to integrate music streaming services (Spotify and Deezer) in Unity3D. Starting with the libspotify SDK written in C for Win32:

But with no luck. I have tried different C# wrappers like libspotifydotnet and libspotify-sharp. But all implementations ends with the same result, which is crashing Unity3D.

The following error occurs when using the libspotify-sharp wrapper (crashing unity): alt text But the libspotify.dll IS in the /Assets/plugins/ folder (path is also correct in the error message!).

Besides the wrapper, i also tried using the libspotify.dll in /Assets/plugins/ directly by creating a simple C# script which imports the libspotify.dll and mapped two functions with it according to the Unity plugins tutorial with the functions described in the documentation of libspotify like so:

 using System;
 using System.Runtime.InteropServices;
 using UnityEngine;
 
 public class TestSpotify : MonoBehaviour
 {
         [DllImport ("libspotify")]
         public static extern string sp_error_message (sp_error error);
 
         [DllImport ("libspotify")]
         internal static extern sp_error sp_session_login (IntPtr sessionPtr, string username, string password);
 
         void Start ()
         {
                 Debug.Log ("result of native lib is : " + sp_error_message (sp_error.OK));
         }
 
     #region Enums
 
         public enum sp_error
         {
                 OK = 0,
                 BAD_API_VERSION = 1,
                 API_INITIALIZATION_FAILED = 2
         }
 
     #endregion
 }

Is my approach wrong? (is the libspotify.dll at the wrong location or do i miss some .NET skills and insights?) because this code also results in the DllNotFoundException.

And who succeeded with implementing the libspotify SDK anyway? because the total amount of information on the internet is like a fart in the wind.. so, any unityproject would be very much appreciated :).

I'm using Unity3D pro and MonoDevelop as development environment.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image indiegamerdev · Mar 17, 2015 at 10:55 AM 0
Share

Were you able to find anything with this? I seem to be having the same issue.

Thanks so much, Greg

avatar image McRonald · Mar 19, 2015 at 09:55 AM 0
Share

nnnoope, could not get it started. I have tried posting different threads on answers/forum.unity3d and stackoverflow, but still no response... i would gladly help to realize this though.

I'm now using local files combined with local and online music analytics.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by indiegamerdev · Mar 19, 2015 at 01:53 PM

Try downloading the latest dll from the linspotify site that seemed to work for me I'm also running 32 bit unity. Good luck!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image McRonald · Mar 19, 2015 at 01:54 PM 0
Share

i'll try that!

avatar image
0

Answer by SoylentGraham · Aug 17, 2015 at 04:12 PM

DLLNotFoundException can often refer to the DLL's dependancies.

Find Dependancy walker (http://www.dependencywalker.com/) and open libspotify.dll and see if there are any extra DLL's it might need. These then need to be placed in the same place as your "plugin"'s DLL.

It could also be 32 vs 64 bit.

Try attaching the visual studio debugger to unity BEFORE the first attempt to load the plugin and it should give you some extra information (like the 32 vs 64 bit error)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Speaker/earphone audio output toggle from unity c# script using "Lesser AudioSwitch" app 0 Answers

Custom Inspector for Hex Editor? 0 Answers

NullReferenceException in a wrapper 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges