question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

first record results in float64, subsequent in float32

See original GitHub issue

the following

import soundcard

mics=soundcard.all_microphones()
mic=mics[1]
with mic.recorder(samplerate=48000, blocksize=4096, channels=1) as m:
  data=m.record(1024)
  print(data.dtype)
  data=m.record(1024)
  print(data.dtype)
  data=m.record(1024)
  print(data.dtype)

gives as output:

float64
float32
float32

while expected is:

float32
float32
float32

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bastibecommented, Oct 8, 2019

Never mind, it turns out the error was trivial. The latest commit should fix it.

0reactions
ipelupessycommented, Dec 17, 2019

think so too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Go: Why does converting from a float64 to a float32 and back ...
When you convert to float32 , the value must be rounded to the nearest value representable as a float32 . The lost information...
Read more >
Error bands must have compatible data types; found ...
I have tried to export this image to my drive and I get the next error: bands must have compatible data types; found...
Read more >
15. Floating Point Arithmetic: Issues and Limitations — Python ...
Binary floating-point arithmetic holds many surprises like this. The problem with “0.1” is explained in precise detail below, in the “Representation Error” ...
Read more >
Data Types and Formats – Data Analysis and Visualization in ...
If we divide one integer by another, we get a float. The result on Python 3 is different than in Python 2, where...
Read more >
Efficient float32 arithmetic in JavaScript - The Mozilla Blog
Now, one useful property of float64 arithmetic that JavaScript engines have ... or float64 operations and obtain the same float32 result.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found