jwallet / spy-spotify

🎤 Records Spotify to mp3 without ads and adds media tags to the files 🎵
https://jwallet.github.io/spy-spotify/
MIT License
2.12k stars 139 forks source link

Not a WAVE file - no WAVE header #224

Closed vipermetcaff closed 4 years ago

vipermetcaff commented 4 years ago

Error Report

Application: Spytify
Version: 1.6.0.0
Region:
Date: 4/30/2020
Time: 11:37 PM

Error Message: Not a WAVE file - no WAVE header

Stack Traces

Top-level Exception
Type:    System.FormatException
Message: Not a WAVE file - no WAVE header
Source:  NAudio
Stack Trace: at NAudio.FileFormats.Wav.WaveFileChunkReader.ReadWaveHeader(Stream stream)
   at NAudio.Wave.WaveFileReader..ctor(Stream inputStream, Boolean ownInput)
   at EspionSpotify.Recorder.<WriteStreamOutputToFileBasedOnNumberOfChannels>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EspionSpotify.Recorder.<WaveIn_RecordingStopped>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Assembly References

System Info

Operating System
-Microsoft Windows 10 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -360
--FreePhysicalMemory = 12562464
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 10.0.18362

Machine
-VIPERSPC
--Manufacturer = System manufacturer
--Model = System Product Name
--TotalPhysicalMemory = 17116495872
jwallet commented 4 years ago

hi there thanks for reporting the issue

Type in Explorer path: %APPDATA%, back of one folder and go to /Local/Temp/

image

vipermetcaff commented 4 years ago

%APPDATA% its been happening on every recording yes its showing the temp files in /local/temp i got it working

ghost commented 4 years ago

%APPDATA% its been happening on every recording yes its showing the temp files in /local/temp i got it working

can you explain the solution i have same issue

jwallet commented 4 years ago

you have to give access to spytify to write in temp data, normally any app can do. Here are some stuff to try:

You should see a .tmp file being added to the most recents file in YOUR_USER\AppData\Local\Temp\

h

@vipermetcaff @rock6663 let me know what worked so I can prevent this in the future

ghost commented 4 years ago

you have to give access to spytify to write in temp data, normally any app can do. Here are some stuff to try:

  • make sure you don't run the app in the zip file, unzip it somewhere like your User/Desktop
  • run the app as an admin
  • this app has no certificate, so antivirus might block it from executing, make sure it is whitelisted
  • try to move the app folder to C:\ drive root (normally the app will have more rights after the move)

You should see a .tmp file being added to the most recents file in YOUR_USER\AppData\Local\Temp\

h

@vipermetcaff @rock6663 let me know what worked so I can prevent this in the future

@jwallet i tried these it worked but i realised something it works but only when i dont do anything (surfing the web chatting from dc etc.) on pc. when i start to do something it gives same error again

jwallet commented 4 years ago

is it because another app is requesting the sound card, maybe set the audio device as Virtual Audio Device and output Spotify to the same one ?

WVLFI commented 4 years ago

Having same issue here, tried everything you suggested @jwallet . Didn't fix it Unlike @rock6663 even if I don't use my computer the error still persists. Something I would like to point out is that I am using the 'LastFM' API because the 'Spotify' API is not available for me to select (grayed out). Hope you can fix the issue soon.

vipermetcaff commented 4 years ago

still doing it to me

jwallet commented 4 years ago

comment for devs:

Recorder.cs#L119 new NAudio.WaveFileReader(_tempFile) look like it can't open the file because it is still locked, some report that they solve the issue using System Stream instead

WVLFI commented 4 years ago

Any suggestions on how do do that? the system stream. Not too familiar with that

jwallet commented 4 years ago

if this happens for anyone, I will like to see the actual console logs, screenshots of settings you use, upload here the .tmp files that you have, like shown above related to spytify apps (order by date - recents) and the song used that failed to save to mp3 https://open.spotify.com/search. My guess at the moment is a third party app that keep spytify from writing on the disk like anti-malware, anti-virus, looks like this issue does not hit all 3,000 ish users online right now.

WVLFI commented 4 years ago

Hey @jwallet , just wanted to let you know that this only affects my laptop, has no effects on my pc. my pc is more updated and kept away from apps that look shady, and the pc is using the latest windows updates. Both pc and laptop have default windows defender installed and do not have any third party anti virus installed. Thought this might help.

ghost commented 4 years ago

I also don't think this is an issue with Spytify, it is happening on other programs in Windows

I think the error literally states that it expected a WAVE file but got an mp3 file. I'm currently using the WAVE file export function and it's working

Yup it's confirmed you just need to select the WAVE file export. I don't program much so I can't fix the issue but I hope that the dev can fix it soon

p.s. Moving it to C drive even in windows programs doesn't make it work

ghost commented 4 years ago

Basically you can:

  1. Change the export to a WAV file (worked for me)
  2. Go to sound in the control panel, then to recording then right click and click view disabled then if a new one pops up then right click, select properties and in the very bottom drop down menu select, use this device
  3. Try using a fresh install
  4. Disable your anti-virus
  5. Don't run anything else and check if it works
  6. Do everything at once including moving it C drive. No antivirus, nothing else is on, change it to WAV and fresh install and try to delete the previous .spytify files because they can interfere in some ways
jwallet commented 4 years ago

selecting wav format does not execute the same code, that's why it is working.

vipermetcaff commented 4 years ago

im useing an older version of spytify v1.2 with the vb audio Calbe and it works Great Havent Had Any Errors

ghost commented 4 years ago

im using an older version of spytify v1.2 with the vb audio Calbe and it works Great Havent Had Any Errors

Could you send the source code to me?

jwallet commented 4 years ago

subscribe to this thread for those who have the issue, I'm gonna release here the debug version to see what could fix it. I can't reproduce the issue myself. image

looking for helpers

tmp file needed

Also can someone add here, the header of a .tmp file that Spytify created that failed. The path to a .tmp file is shown in my .gif above, you can open it with notepad and copy the first 3 lines... or just paste the file in the Reply box here Thanks

settings needed

if you can screenshots the settings and advanced settings you were using, (cover/hide your outputh path)

jwallet commented 4 years ago

it should log the error into the console

spytify-audio-writer.zip

niknak101 commented 4 years ago

Hi jwallet, first thanks for your work on this app. I'll contribute with a translation soon.

I'm receiving the same WAVE header error message.

I tried just now using the "spytify-audio-writer" debug version you posted above, and receive the following error message on the log (output path has been blurred):

Error while recording: Unknown exception: tempFile used: F:\Users\username\AppData\Local\Temp\tmp84F9.tmp, track used: Zhavia Ward - All I Am, The byte stream type of the given URL is unsupported. (Exception from HRESULT: 0xC00D36C4)

image

image

Instead of a TEMP file, a failed MP3 output was created in the output folder. See attachment.

output.zip

jwallet commented 4 years ago

another one here: spytify-reset-position-without-flush.zip

niknak101 commented 4 years ago

This latest one (spytify-reset-position-without-flush.zip) is working fine for me. Managed to record about 10 songs without error messages, using the same settings as my previous post.

Offtopic: I finished the spanish translation for future versions.

ghost commented 4 years ago

I lied, apparently selecting wav still gets the error. I don't know how but it seems random, I managed to get about 20 songs before it crashed

jwallet commented 4 years ago

I made a PR that applies https://github.com/jwallet/spy-spotify/issues/224#issuecomment-625019343 If you guys here confirm that this is the one that fix the issue you are having I will release a patch @I-Have-Bugs @vipermetcaff @rock6663

Sessionz81 commented 4 years ago

it should log the error into the console

spytify-audio-writer.zip

Hi, I'm not a programmer so have no idea what half of this thread means but I signed up to let you know this link fixed the described problem for me, thank you. I will make sure to donate.

SpookyPootis commented 4 years ago

I made a PR that applies #224 (comment) If you guys here confirm that this is the one that fix the issue you are having I will release a patch @I-Have-Bugs @vipermetcaff @rock6663

Just as the user above, I signed up to say thanks! This fixed the no header issue for me. Just dropped it into C: drive and that's it, no antivirus exception or any other modification. Ill keep updated, thanks a lot.

jwallet commented 4 years ago

Ok then I will release a patch and some other features that were in the pipes