Giter Site home page Giter Site logo

nim-sndfile's People

Contributors

frarees avatar julienaubert avatar simonkrauter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nim-sndfile's Issues

How to write?

Hi there,

I'm running a fork of your bindings with this code:

import sfi
import os

var frames = 34
var sndfile: ptr TSNDFILE
var info: TINFO
info.channels = 1
info.frames = int64(frames)
info.samplerate = cint(44100)
info.format = cint(65542)
info.seekable = cint(1)
info.sections = cint(1)


sndfile = sfi.open(
    paramStr(1).expandTilde(), 
    sfi.WRITE,
    cast[ptr TINFO](info.addr)
    )

var samples = cast[ptr UncheckedArray[cfloat]](alloc0(sizeof(cfloat) * frames))

for i in 0..frames-1:
  samples[i] = cfloat(i)

echo format_check(cast[ptr TINFO](info.addr))

var num_items = cast[int64](info.channels * info.frames)

echo sfi.writef_float(sndfile, samples[0].addr, num_items)

discard sfi.close(sndfile)
dealloc(samples)

but it always returns 0 items written.

In my bindings I simply added the write functions which are almost identical to the read functions.

Any ideas on how I can make this work because right now it doesn't crash but the file is always empty after the program is complete.

Continued development

First of all, thanks for this small wrapper. I noticed that the PR for writing files #7 has not been merged, or any other activity for that matter, in over a year. Currently, I'm using the PR without issues, but it would be great if I could just install it via nimble. Will there be any further updates?

@jamesb93: If there is no more development here, would you be okay if someone changed the URL in the nimble directory to your fork? Are you still using this? Or should I fork your fork, in case people want support?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.